Can't script out jobs

  • When I try to script any job on my 2005 Enterprise instance, I get the following error: "Discover dependencies failed. (Microsot.SqlServer.Smo) Additional Information: Job is not supported in dependency discovery."

    At first I thought it was the specific job that I wanted to script as it is the most complex multi-step job that I have, but then I tried simpler backup jobs and got the same error. I can script out the job by manually querying the appropriate tables, but I'm concerned that this might indicate something a bit more screwy under the hood.

    Thoughts?

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • Someone has filed a bug report about this http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=371669.

    Apparently, Discover depedency doesn't work for jobs. The workaround is to go to Tools -> Options -> Scripting and set "Generate script for dependent objects" to false under "Object scripting options".

    Greg

  • Thank you, Greg! Exactly what I needed. I wasn't feeling well last night and wasn't up to poking around outside of SSC to find an answer.

    Much appreciated.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • Well, I spoke too soon. What I needed to do was script one multi-step job, change some names in it and run the script to create a copy of the job. Unfortunately the copy didn't have the steps in it as the script has specific references to the JobID of the original, which wouldn't match up with the copy.

    So it looks like I'll have to copy the job the hard way, one step at a time.

    -----
    [font="Arial"]Knowledge is of two kinds. We know a subject ourselves or we know where we can find information upon it. --Samuel Johnson[/font]

  • Wherever @job_id (or @jobid, forget which right now) shows up when scripting jobs, you can change that to @job_name = N'New job name here'

    I've been through this when scripting out jobs for multiple servers, and generating the drop/create statements.

    Hope that helps you out a bit.

    Steve

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply