Skip to content

Instantly share code, notes, and snippets.

@joshuaflanagan
Created July 14, 2010 16:45
Show Gist options
  • Save joshuaflanagan/475660 to your computer and use it in GitHub Desktop.
Save joshuaflanagan/475660 to your computer and use it in GitHub Desktop.
Restore a SQL Server database
ALTER DATABASE mydbname SET SINGLE_USER With ROLLBACK IMMEDIATE
RESTORE DATABASE mydbname FROM DISK = 'c:\path\to\file.bak' WITH REPLACE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment