Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

This question already has an answer here:

Long Story Short... my Database server died a month ago. I restored everything but the MSDB as the tape backup failed. I reconstructed some jobs but some essential ones are missing. I finally found the MSDB backup in an old partition, but here's the gist... it isn't a .BAK file but the actual database and log. I already created a new Database in my instance and attached the MSDB (with different name obviously, MSDBJobs) but I have no idea whatsoever on how can I extract the jobs from this database. I don't want to replace the current ones as some are new and essential as well. Thanks for any help provided :)

share|improve this question

marked as duplicate by Shawn Melton, ypercube, Mark Storey-Smith, Paul White, Kin Jan 3 at 14:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

Perhap simplest would be to do the following:

  1. Install a new instance of SQL Server.
  2. Shut down the SQL Server, delete the msdb data and log files.
  3. Copy the old msdb data and log files to the same location as the files you deleted.
  4. Bring up the new instance of SQL Server and script out the jobs. (You can use SSMS Object Explorer Details to select all jobs and create one massive script, or do them one at a time.)
  5. Uninstall the new instance.

There are also scripts, including this powershell script, but they use methods that talk to msdb: http://www.johnsansom.com/script-sql-server-agent-jobs-using-powershell/

share|improve this answer

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