Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2001
    Posts
    36

    Angry Unanswered: How To Script Jobs In SQL Server ?

    How to create SQL script out of job in SQL Server ?

    I know there is a way thru EM, but is there any stored procedure or any function that will return the SQL script of any job.

    I want to script all jobs on my server just as a part backing up mechanism.

    Thanks
    Decasto.

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    After starting Profiler, going into EM and scripting a job I noticed two procs being called...

    msdb..sp_help_jobstep @job_id = XXX
    and
    msdb..sp_help_jobschedule @job_id = XXX

    soooo I suppose you could step through msdb..sysjobs and process each job you find with one or both of the above procs.
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •