From: Martin on
hI,

Could anybody please point me in the direction of the best way to automate
the scripting of jobs to a flat file.
so far I have come u with following

1 use T-SQL in a job to iterate jobs, pull back the text and dump it to file
using xp_cmdshell.
2 use a C# CLR to iterate jobs and dump them to a file.
3 Use an SSIS package and run it from a scheduled job.
4. Create custom C# code and run it from a job.

If the C# / SSIS route is best then could anybody say the best way to do
this - are there any methods availible to script jobs directly from C#?

what I am trying to achieve is to have all jobs from my server scripted off
at regular intervals for disaster recovery purposes.

man thanks in advance.

cheers

martin.

From: Eric Isaacs on
All the job information is stored in the MSDB database. You could
just backup that database and the other system databases and restore
them in the event of a disaster.

-Eric Isaacs
From: Tibor Karaszi on
Agreed. If scripting still is desired, then check out the SMO API. It has
scripting abilities for about everything in SQL Server and is a managed API.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi



"Eric Isaacs" <eisaacs(a)gmail.com> wrote in message
news:5f2fa293-ed0e-4242-8066-28e1a87f4c8f(a)t34g2000prm.googlegroups.com...
> All the job information is stored in the MSDB database. You could
> just backup that database and the other system databases and restore
> them in the event of a disaster.
>
> -Eric Isaacs

 | 
Pages: 1
Prev: Nested Count
Next: Extra row in CTE