-
Automate scripting SQL jobs
Hi
I need to be able to script all my sql jobs into a text file from command prompt.
I can script out all the jobs with SSMS but I need to automate this process.
what do you think is the best way to achive this?
by the way platform is sql server 2005 SP2
Thanks
-
Use profiler to find out what sql does when you script jobs in ssms, then put them in script and run the script in sqlcmd.exe.
-
You could write SQL-SMO to generate SQl Agent JOb scripts.
I wrote this for 2000
http://www.databasejournal.com/featu...le.php/3401081
For 2005, you could use SMO and powershell. Some examples
http://www.databasejournal.com/featu...le.php/3705236
This will give you are high level idea for creating such automated script.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|