Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- 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
You can’t perform that action at this time.