Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 7,2000
»
General
»
Executing batches asychronously?
Executing batches asychronously?
Rate Topic
Display Mode
Topic Options
Author
Message
Arun T Jayapal
Arun T Jayapal
Posted Wednesday, November 14, 2007 8:09 AM
Grasshopper
Group: General Forum Members
Last Login: Wednesday, December 12, 2012 11:12 PM
Points: 13,
Visits: 50
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?
Post #422114
Jez-448386
Jez-448386
Posted Wednesday, November 14, 2007 9:22 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, May 24, 2013 2:32 AM
Points: 227,
Visits: 605
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
Post #422158
EvilPostIT
EvilPostIT
Posted Wednesday, November 14, 2007 9:34 AM
Right there with Babe
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:35 AM
Points: 734,
Visits: 636
You could use the sp_add_job to create a job which deletes itself after running and then execute it using sp_start_job.
Nuke the site from orbit, its the only way to be sure...
Post #422172
Arun T Jayapal
Arun T Jayapal
Posted Wednesday, November 14, 2007 11:20 AM
Grasshopper
Group: General Forum Members
Last Login: Wednesday, December 12, 2012 11:12 PM
Points: 13,
Visits: 50
"Create a job which deletes itself..."???!
Explain.
Post #422242
EvilPostIT
EvilPostIT
Posted Wednesday, November 14, 2007 3:32 PM
Right there with Babe
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:35 AM
Points: 734,
Visits: 636
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.
Nuke the site from orbit, its the only way to be sure...
Post #422355
EvilPostIT
EvilPostIT
Posted Thursday, November 15, 2007 4:18 AM
Right there with Babe
Group: General Forum Members
Last Login: Wednesday, February 20, 2013 1:35 AM
Points: 734,
Visits: 636
Arun,
Has this helped?
Nuke the site from orbit, its the only way to be sure...
Post #422539
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.