Search This Blog

Wednesday, March 1, 2017

Restore SQL database backup

If you are having trouble restoring SQL database from backup, try this SQL script (replace values in italic with your actual values)

ALTERDATABASE db_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTOREDATABASE db_name FROM DISK = 'db_backup_path'
WITH REPLACE
GO

No comments:

Post a Comment