December 19, 2002 at 9:53 am
Hi all,
I need some help. I need to invoke a job based on some event. The job needs to be invoked from a stored procedure.
Any ideas?
Anything would help.
Thanks
December 19, 2002 at 10:47 am
Use the sp_start_job system stored procedure for it. Look for help on it to find the details and other procedures that deal with jobs.
Michael
December 19, 2002 at 12:24 pm
Try something like:
EXEC msdb..sp_start_job @job_name = @JobName
Gary Johnson
DBA
Sr. DB Engineer
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
December 19, 2002 at 3:14 pm
The only downside with sp_start_job is if it is already running it will throw an error. Check the job state first before executing by using sp_help_job or look at it's code details and get out the select for just the execution status. Check it first and you can avoid the error.
December 19, 2002 at 4:22 pm
Thanks a lot guys
I really appreciate your help.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply