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

Managing Jobs Using TSQL Expand / Collapse
Author
Message
Posted Friday, March 21, 2003 12:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, August 14, 2007 1:40 PM
Points: 42, Visits: 1
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/RDyess/managingjobsusingtsql.asp


Post #10789
Posted Tuesday, April 6, 2004 5:07 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: 2 days ago @ 2:39 PM
Points: 192, Visits: 132

Excellent. I have the similar situation of handling about 80 above servers. You script of join sj and sh solve most of my delima of checking server by server and consolidate all into one table.

I made following changes:

1. declare @daydiff int           select @daydiff = 1 'in case I am only interested in last night job

 where cast(left(cast(run_date      as char(8)), 4)    as int)= datepart(yyyy, getdate())
   and cast(substring(cast(run_date as char(8)), 5, 2) as int)= datepart(month,getdate())
   and cast(right(cast(run_date     as char(8)), 2)    as int)= datepart(day,  getdate()-@dayDiff)
   and sh.step_name <> '(Job outcome)'

2. I filtered out the step_name = '(Job outcome)'

3. I union all servers

4. Finally, I create 2 cursor loops to find any existing databases on 80 servers either missing the job set up or with failure status. It works great in either case.

thanks

-D

 




Post #110100
Posted Tuesday, April 6, 2004 5:10 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: 2 days ago @ 2:39 PM
Points: 192, Visits: 132

One thing:

why the name of sj and sh data type are sysname? which causes centain problems in datalength() function...

-D




Post #110101
Posted Monday, September 14, 2009 10:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 14, 2009 10:26 AM
Points: 1, Visits: 8
Have you updated this routine to work on SQL Server 2005?


Post #787593
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse