Showing posts with label Backup. Show all posts
Showing posts with label Backup. Show all posts

To Cleanup Backup and Restore history

To remove the Backup and Restore related history from the system tables older than the specified date:

USE msdb
GO
EXEC sp_delete_backuphistory '2011-01-31'
GO

To remove the Backup and Restore related history from the system tables for the specified Database:

USE msdb
GO
EXEC sp_delete_Database_backuphistory 'SQLDB1'
GO

Backup/Restore history removed from the following system tables
1.backupfile
2.backupfilegroup
3.backupmediafamily
4.backupmediaset
5.backupset
6.restorefile
7.restorefilegroup
8.restorehistory