Command line stored procedures

Adding, modifying and deleting

There are two methods for creating a scheduled job: by specifying both the job and schedule information in one operation, or by defining the job and the schedule separately and then combining them into a scheduled job.�

Reporting and listing

Stored procedures are provided for the command line interface to obtain information about the jobs and schedules configured in the Job Scheduler database. The information can be provided in a formatted report or as a simple list.�

Running jobs

You can run jobs by scheduling them or using ad hoc commands.

Jobs history and output

It is possible to manage job history and job output separately. Deleting job history also deletes any corresponding job output, but deleting job output records does not delete job history. This flexibility allows for different rules to govern how much job history and job output is retained.�

Job Scheduler users without the js_admin_role are restricted to viewing and manipulating the job history and job output from jobs which have their user name recorded in the history entry. However, a user with js_admin_role can use the all option to override this limitation and extend the scope to the history and output to all Job Scheduler users.�

Table 5-1: Job Scheduler stored procedure descriptions

Procedure name

Procedure purpose

Create, modify, delete

sp_sjobcreate

Creating scheduled jobs, jobs or schedules

sp_sjobcmd

Managing the SQL command text of a job

sp_sjobmodify

Modifying scheduled jobs, jobs and schedules

sp_sjobdrop

Removing scheduled jobs, jobs and schedules

Reporting, listing

sp_sjobhelp

Reporting and listing of scheduled and running jobs

Running jobs

sp_sjobcontrol

Job Scheduler administration and control of scheduled or running jobs

Jobs history, output

sp_sjobhistory

Viewing and administration of the job history and output