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
 General SQL Server Forums
 New to SQL Server Programming
 Weekly Jobs

Author  Topic 

AndyNic
Starting Member

1 Post

Posted - 2010-07-05 : 06:51:43
This runs as a weelky Maintanace Plan but I am not sure what it actually does.
Any clues?

declare @dt datetime
select @dt = getdate()-30
exec msdb.dbo.sp_delete_backuphistory @dt
EXEC msdb.dbo.sp_purge_jobhistory @oldest_date=@dt
EXECUTE msdb..sp_maintplan_delete_log null,null,@dt

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-07-05 : 06:53:26
It removes all job history records (job log) older than 30 days.



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

- Advertisement -