Presents your SQL SERVER E-NEWSLETTER for March 11, 2003 <-------------------------------------------> START A SQL AGENT JOB USING T-SQL The system-stored procedure sp_start_job is the mechanism to start a SQL Agent job using T-SQL. This procedure will start the job and return control back to the user without waiting until the job is completed. A return value of zero indicates that sp_start_job has successfully started the procedure, while a return value of one indicates the opposite. One reason failure can occur is because the SQL Agent service is not running. The sp_start_job system-stored procedure has six input parameters: * @job_name--This is the name of the job in SQL Agent. * @job_id--This is the identification number of the SQL Agent job. * @error_flag--This is a reserved parameter. * @server_name--This is the target server on which to start the job. * @step_name--This is the job step name on which the job should be started. This also applies to jobs that are on the local server. * @output_flag--This is a reserved parameter. The system-stored procedure requires either the @job_name or @job_id parameter, but not both parameters. The rest of the parameters are optional. This procedure is available to any user within the database. ----------------------------------------