Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 1434 | Views in the last 30 days: 6
 
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

Restore All Backups

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

ARTICLE

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.

FORUM

Script to restore red gate backups automatically from a folder.

Restore of red gate backup files using a SQL Script

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones