Skip to content

RESTORE

RESTORE DATABASE TestDB
FROM DISK = 'C:\BackupFolder\TestDB.bak'
WITH RECOVERY
5 percent processed.
10 percent processed.
...
100 percent processed.
Database 'TestDB' restored successfully.

The given code is used to restore a SQL Server database named ‘TestDB’ from a backup file located at ‘C:\BackupFolder\TestDB.bak’. The ‘WITH RECOVERY’ option brings the database online immediately after the restore operation is finished. The output indicates the process of restoration in percentages and confirms successful restoration upon completion.