How to restore a database backup (Transact-SQL)
To restore a database backup
Important The system administrator restoring the database backup must be the only person currently using the database to be restored.
- Execute the RESTORE DATABASE statement to restore the database backup, specifying:
- The name of the database to restore.
- The backup device from where the database backup will be restored.
- The NORECOVERY clause if you have a transaction log or differential database backup to apply after restoring the database backup.
- The name of the database to restore.
- Optionally, specify:
- The FILE clause to identify the backup set on the backup device to restore.
Examples
This example restores the MyNwind database backup from tape:
USE master
GO
RESTORE DATABASE MyNwind
FROM TAPE = '\\.\Tape0'
GO
See Also
Identifying the Backup Set to Restore
Rebuilding the master Database