Question

When I take a backup of a database (SQL Server), is there any way that I can include a scheduled job in the backup?

I have a database with stored procedures and a maintenance job that runs some of the stored procedures nightly.

I would like to achieve a minimal effort to schedule the job, when the .bak file is restored into a server, back as a database.

Was it helpful?

Solution

I don't have the quick button to click for your problem, but I think (not sitting in front of it right now) You can right click a job and get a script for its creation including scheduling specifics. I don't know how to include a job in a backup and how to restore it, though. I think restoring a job would require a script with the CREATE for the job to be run.

OTHER TIPS

You can also back up the msdb database. The msdb database is where all the jobs live, it is one of the system databases, and then restore your database plus msdb.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top