Jump Start: Database Restore

One basic element of reliability is the ability to quickly restore a database

Michael Otey

January 22, 2007

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A good data-protection plan involves two core activities: backup and restore. In this article, I cover basic full-backup restore. Before jumping into the T-SQL RESTORE commands, I should point out that similar to SQL Server 2005, SQL Server Express supports multiple types of backup and restore options including full, differential, and log backups.

As with the SQL Server Express database backup options, you can restore a database by using either SSMSE or T-SQL commands from SQLCMD or Query Editor. I'll show you how to use the T-SQL RESTORE commands in this text. The following code restores the MediaCollection database from a previous full-database-backup disk file named MediaBackup.bak: RESTORE DATABASE MediaCollection FROM DISK = 'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBACKUP MediaBackup.bak'

As you can see, the RESTORE command for a full backup is straightforward. You provide the name of the database you want to restore after the RESTORE DATABASE command, the name of the disk backup file, followed by the FROM DISK = clause. It's that simple.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like