Created
September 13, 2017 21:28
-
-
Save danhaywood/1560f8ae51b4a0a76a31c3176e8cd574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- run in the target database | |
-- (but there must be no other logins using that database otherwise will fail). | |
declare @sql varchar(max) | |
set @sql = 'RESTORE DATABASE ' + DB_NAME() + ' FROM DATABASE_SNAPSHOT = ''' + DB_NAME() + '_snapshot''' | |
use master | |
select @sql | |
exec(@sql) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment