SQL server, SQLServerPedia Syndication

Purging MSDB table.

These msdb tables include:

  • backupfile
  • backupfilegroup
  • backupmediafamily
  • backupmediaset
  • backupset
  • restorefile
  • restorefilegroup
  • restorehistoy
-- delete all backup/restore history prior to a specified date

use msdb go exec sp_delete_backuphistory '2009-04-02' go

-- delete all backup history for a specific database
use msdb go exec sp_delete_database_backuphistory 'test1' go
Advertisements
Standard

Thinking about someting? Leave a Reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s