Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Configuring a job to check for any running jobs Expand / Collapse
Author
Message
Posted Wednesday, April 2, 2014 10:38 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Sunday, November 23, 2014 3:06 PM
Points: 172, Visits: 891
Hi all,

We will soon be migrating to SS2K8, and before we cutover we need take our DB's offline/into Single User mode. In order to ensure consistency we need to ensure that process waits until any running have finished.

I have prepped a small script for the task, but would appreciate any advice on how to go further...


Select *
From sysjobhistory
Where run_status <>1

WAITFOR DELAY '00:00:10'

Select *
From sysjobhistory
Where run_status <>1

Thanks,

Jake
Post #1557602
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse