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 2008 Forums
 Other SQL Server 2008 Topics
 SQL Jobs

Author  Topic 

gsarda
Starting Member

1 Post

Posted - 2010-08-26 : 05:42:39
I have a Job on our SQL Sever 2008 that executes stored procedure in every hour. The stored procedures aggregates data from one database to another applying some business rules on it to a SQL Server database. On average it takes about 3 minutes to run the job. But if job takes for more than an hour, then, another job starts and start running aggregation on same set of data. Thus, aggregated number is duplicated/more than the original number of records. How can I setup the job in a way if the job is still running after 50 minutes then stop the job? Or is there a better way to avoid the job from running nonstop and hitting the data integrity?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-26 : 06:45:45
I guess you can implement some sort of this code?
http://weblogs.sqlteam.com/peterl/archive/2008/11/27/Run-jobs-synchronously.aspx



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -