Snapshot

Take a snapshot and restore it.

Last updated:

Warning: Review and test in a non-production environment before running.

Back to results

CREATE DATABASE [Adv_20170301]
 ON
(NAME = AdventureWorks2012_Data,
 FILENAME = 'D:\CourseMaterials\eDate\UserDataFiles\AdventureWorks2012_Data.ss'
)
AS SNAPSHOT OF [AdventureWorks2012];
GO 

ALTER DATABASE AdventureWorks2012 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE AdventureWorks2012 FROM DATABASE_SNAPSHOT = 'Adv_20170301';
ALTER DATABASE AdventureWorks2012 SET MULTI_USER;
GO