November 14, 2007 at 8:09 am
Say I have a procedure inside which I have the task of sending out emails...this may be another procedure or a batch of statements. Can I run this separately without my main batch processing not waiting or blocking for this task?
November 14, 2007 at 9:22 am
No. You can only do this by having a job that runs (say every 5 minutes) to send the emails or execute other batch proceses.
Jez
November 14, 2007 at 9:34 am
You could use the sp_add_job to create a job which deletes itself after running and then execute it using sp_start_job.
November 14, 2007 at 11:20 am
"Create a job which deletes itself..."???!
Explain.
November 14, 2007 at 3:32 pm
The syntax for sp_add_job has a parameter called @delete_level. If you use this you can set the job to delete itself on completion (wether it is successful or not).
You will need to look at sp_add_job,sp_add_jobstep & sp_start_job. (all in msdb)
Quickest and easiest way to work all this out is to run sql profiler filtered by your username and create a job in enterprise manager. It will give you all the code you need. Job explore the options a little more to make sure your getting everything you want.
November 15, 2007 at 4:18 am
Arun,
Has this helped?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply