Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Running a job

Author  Topic 

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-11 : 02:41:44
hello guys,

If i run sp_start_job 'test' in a stored procedure, as am calling it from my web page, does the SP wait for the job to finish before giving a status code to the web page, or it releases the resources immediately ?

Am new to jobs and want to start a job from a web page that takes up to an hour.

Its called from a stored procedure, and I want to free the resources back to the user. how can this be achieved ?

Or is there a simpler way ?

thanks





_____________________


Yes O !

SimpleSQL
Yak Posting Veteran

85 Posts

Posted - 2008-10-11 : 03:05:10
sp_start_job will only start the job, it will not wait for the job to finish.

Why do you need to start the job from applicaiton. If you need to schedule a job at a particular time, you can do so by setting a schedule for this job (one time or recurring) from within SQL Server.
Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-11 : 03:09:41
Thanks,
Are there any resources out there on jobs. I cant seem to find any on MS website.

Well, we have a user subscription that runs a CSV file and updates a log table. And it takes a while to run, we initially implemented a trigger to kick of a SP to run the process, which should be oblivious to the user and calling app.

But we want to try other methods without running a trigger.

_____________________


Yes O !
Go to Top of Page

SimpleSQL
Yak Posting Veteran

85 Posts

Posted - 2008-10-11 : 03:32:19
http://msdn.microsoft.com/en-us/library/ms186273.aspx

This link gives you information on how to create Jobs/Schedule it etc..

Go to Top of Page

mary_itohan
Posting Yak Master

191 Posts

Posted - 2008-10-11 : 07:11:26
tnx

_____________________


Yes O !
Go to Top of Page
   

- Advertisement -