Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts

Friday, March 23, 2012

Scheduled Task

Does anyone know how I can run a t-SQL script using the Microsoft Scheduled Task Wizard? I want either Q.A, or E.M to automatically start up and then run a script that I saved on my c: drive.
ThanksSQLAgent service account must have READ access to your C drive. You can have an OS command in the job step that fired OSQL with an -i ponting to the UNC of your C drive (\\your_pc_name\c$ or \\your_pc_name\share_name)|||Try osql and BAT.|||I've never used osql before and am having trouble logging in. It prompts me for the password and the just closes the window. I am putting in my windows password.
Thanks|||-E will let you in without having to enter the password if you have your login on the server.|||I am getting an error that says it doesn't exist or access denied.|||-S your_server_name -E|||Everything worked. Thank you very much for your help.

Wednesday, March 7, 2012

Schedule Jobs

QUick question:
Using T-SQL, How can I change the time of an schedule job?jaraba,

Try using sp_update_jobschedule.

Have some fun.

Tuesday, February 21, 2012

Schedule a T-SQL Script

I have a T-SQL script that creates a SQL Backup using Idera's SQLSafe.
It works great in QA, but I now wish to schedule the backup, and I am
not sure the best approach.
The script contains cleartext accounts and passwords, so I would like
to avoid storing it on a drive.
I thought I could create a stored procedure, but I dont know how I
could then schedule it.
Any thoughts?
TIA,
RobDOH, tried right clicking on the "Jobs" item under Management in EM, I
didnt know I could add jobs on the fly like that!
I just pasted my SQL and scheduled the job.
Simple
:)