Immediately executes a SQL Executive scheduled task either from a command batch or from a user-defined stored procedure.
sp_runtask {'task_name' | @task_id = n }
where
This procedure must be run from the msdb database.
PRINT 'Running sp_runtask...' EXECUTE msdb.dbo.sp_runtask @taskid = 56 PRINT 'Finished'
CREATE PROC RunTask56 AS BEGIN EXECUTE msdb.dbo.sp_runtask @taskid = 56 END
Execute permission defaults to the public group.