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)

Restore database from a device containing multiple backups

By Smitha Reddy,

If you have multiple backup database backups on a single SQL Server 2008 R2 backup device, this script will help you restore a database from the LATEST full and differential backups residing on that backup device.


If this script is to be used for restoring a SQL Server 2005 database, please remove "CompressedBackupSize" from the CREATE temporary table statement.


The following page contains a stored proc script for restoring all databases from a number of backup files:

http://www.karaszi.com/SQLServer/util_restore_all_in_file.asp

I used information on the above page in constructing my "CREATE TABLE #RestoreHeaderOnlyData" script.

Total article views: 1778 | Views in the last 30 days: 1
 
Related Articles
SCRIPT

Backup & Restoration Script

This script provides very useful information about database backup and restoration.

SCRIPT

Script to Restore Entire database from a directory

Script to restore the entire databases from the backup directory just by passing the backup director...

SCRIPT

Generate RESTORE DATABASE Script without Using CMDSHELL

Use this script to generate RESTORE DATABASE scripts for all .BAK backup files from backup location ...

SCRIPT

Restore script for Ola Hallengren backup

Create a restore script based on backup files in a directory

SCRIPT

Restore All Backups

SCRIPT TO RESTORE BACKUP FOR ALL DATABASES, PLACED IN FOLDER CALLED ORIGIN_FOLDER, WITH THE INITIAL...

Tags
backup    
multiple backups    
restore    
restore headeronly    
 
Contribute