Back to results for “Architecture”
SQL Server › Backup & Recovery

How do you restore a SQL Server database from a full backup file?

Beginner

Answer

You use the RESTORE DATABASE statement, specifying the database name and the location of the backup file, and SQL Server will recreate the database exactly as it existed at the moment that full backup was taken, which is the starting point for any more complex restore involving additional differential or log backups.
RESTORE DATABASE MyDatabase
FROM DISK = 'C:\Backups\MyDatabase_Full.bak'
WITH RECOVERY;
Real-world example An administrator restores a company's customer database from last night's full backup after an accidental deletion, quickly bringing the important customer data back online for the team.

Common follow-ups: What is the difference between WITH RECOVERY and WITH NORECOVERY during a restore?;Can you restore a backup to a server with a different name than the original?