dbTalk Databases Forums  

Calling sp_start_job

microsoft.public.sqlserver.programming microsoft.public.sqlserver.programming


Discuss Calling sp_start_job in the microsoft.public.sqlserver.programming forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harry Strybos
 
Posts: n/a

Default Calling sp_start_job - 08-20-2009 , 12:51 AM






Hi All

I have a fairly large stored proc that does some analysis of financial data
(returning about 2-3k rows) using about 10 different T_Sql queries and
writes the results of each to a temp table which I then save to another
table. This is the result of daily financial reconciliation for historical
purposes. This is called from our in-house VB.Net/C# application.

While I run this through a component class in the background, my thinking is
that it may be better to execute a Sql job using sp_start_job via ADO.Net
since I do not require any feedback on whether it completed. The failure of
the job will be emailed to me, if that occurs. This call has been used many
thousands of times in production and has never failed.

My question is:

Does/can a call from VB.Net to sp_start_job release immediately after making
the call or does it wait for the job to complete? My apologies for posting
this in two groups but either group could have an answer that is useful.

Thank you for your time

Harry

Reply With Quote
  #2  
Old   
ML
 
Posts: n/a

Default RE: Calling sp_start_job - 08-20-2009 , 03:29 AM






The sp_start_job system procedure only notifies SQL Server Agent to start the
job, then returns to the caller.

It does not wait for the job to complete, nor does it monitor job progress.
It makes a few checks *before* initiating the job, but nothing after the job
has started.

You will therefore need another way of monitoring job execution (e.g. using
sp_help_job).


ML

---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.