What is the difference between jobs and maintenance plan in sql server?
I am confused about where I should use job and where maintenance plan.
What is the difference between jobs and maintenance plan in sql server?
I am confused about where I should use job and where maintenance plan.
Jobs are user defined scheduled tasks (could be stored procedures, emails and more).
Maintenance plans are used to optimize the database.
From MSDN:
Maintenance plans create a workflow of the tasks required to make sure that your database is optimized, is regularly backed up, and is free of inconsistencies.
A maintenance plan may use jobs as part of the workflow.
A job may be part of a maintenance plan.
A Maintenance plan is a GUI that can create one or more SQL Jobs to maintain one or more Databases on your Server.
If you want to perform scheduled Database maintenance then use a Maintenance Plan. If you want to perform some kind of custom action e.g Clearing a sessions table then create your own Job.
In most cases there is no need to create your own Maintenance Jobs and the GUI does a good job.