Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

List SQL backups

By J. T. Shyman,

During the process of developing a script to make copies of local SQL database and transaction log backups, I needed to come up with an easy way of locating the backup files. This script queries the SQL2000 backup tables in the msdb database and returns backup start dates, types (D=database, L=Log, I=Differential) and the location of the backup file.

The variable @DBName should be set to the name of the database you want to query on. It is not case sensitive unless your collation is.

The variable @Days should be set to how many days back in the records you want to list backups for.

Total article views: 584 | Views in the last 30 days: 3
 
Related Articles
FORUM

database backup

database backup

FORUM

backup database

backup database

FORUM

Database backup

Database backup

FORUM

Database Backup

Database Backup

FORUM

Proper way to backup databases

backup databases

 
Contribute