Wednesday, 20 July 2011

find out New created Maintanance plan&Jobs in week

PRINT '===================================='
PRINT 'New created Maintanance plan in week'
PRINT '===================================='
select CONVERT(VARCHAR(25), plan_name)  plan_name,date_created 
from msdb..sysdbmaintplans 
where convert(varchar(8),date_created,112)> convert(varchar(8),getdate()- 7,112)
PRINT '=========================='
PRINT '  New created Job in week '
PRINT '=========================='
select * from  msdb..sysjobs where date_created > convert(varchar,getdate()-7,101)

No comments:

Post a Comment