2

How do I retrieve information about a SQL Server Agent job scheduled against databases on SQL server 2005?

6

Jobs are DB agnostic: the steps that comprise a job may have a database context

sysjobsteps has a database_name column

Name of the database in which command is executed if subsystem is TSQL.

You can join this back to sysjobs and the other related tables to get what you need.

6
  • Thanks for your reply, but if the subsystem is SSIS then the Database Name in the sysjobsteps is null. – John Jan 3 '12 at 15:03
  • @John: of course. These details are in the SSIS package... – gbn Jan 3 '12 at 15:04
  • can u please help how I can retrive the same details if the Subsystem is SSIS – John Jan 4 '12 at 9:55
  • @John: sorry, you can't from SQL Server. – gbn Jan 4 '12 at 10:19
  • What is the other Way??? – John Jan 5 '12 at 10:07
1

Based on your comment string with gbn, I'd recommend that you connect to the SSIS instance using SSMS. Then you would find the specific package (under "Stored Packages" and either "File System" or "MSDB") and right-click the package and export it. You'd wand to choose "File System" for the destination. The you can edit the package inVS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.