sp_add_job [@job_name =] '<job name>'
[,[@enabled =] <0 for no, 1 for yes>]
[,[@description =] '<description of the job>']
[,[@start_step_id =] <ID of the step you want to start at>]
[,[@category_name =] '<category>']
[,[@category_id =] <category ID>]
[,[@owner_login_name =] '<login>']
[,[@notify_level_eventlog =] <eventlog level>]
[,[@notify_level_email =] <email level>]
[,[@notify_level_netsend =] <netsend level>]
[,[@notify_level_page =] <page level>]
[,[@notify_email_operator_name =]
'<name of operator to email>']
[,[@notify_netsend_operator_name =]
'<name of operator for network message>']
[,[@notify_page_operator_name =] '<name of operator to page>']
[,[@delete_level =] <delete level>]
[,[@job_id =] <job id> OUTPUT]
Again, most of the parameters here are self-describing, but let's touch on some of the more sticky ones.
<< @start_step_id: This one is going to default to 1, and that's almost always going to be the place to leave it. We'll be adding steps
shortly, but those steps will have identifiers to them, and this just let's the SQL Server Agent know where to begin the job.
@category_name: This one equates directly with the category we saw in the EM. It will often be none, but could be a Database
Maintenance (another common choice), Full Text, Web Assistant or Replication category.
@category_id: This is just a way of providing a category without being dependent on a particular language.
@notify_level_eventlog: For each type of notification, this determines under what condition the notification occurs. In EM, this was the
far right combo box in the notification tab. To use this sproc though, we need to supply some constant values to indicate when we want
the notification to happen. The constants are: >>
[/b]JOY!
SHUX