Database Snapshots

CREATE Snapshot:

Note that NAME=AdventureWorks2008R2_Data is the logical name of the source’s datafile

Revert to Snapshot:

Reverting will fail if other users are connected. Here’s how to put the database in single user mode:

ALTER DATABASE YourDB<br />SET SINGLE_USER WITH<br />ROLLBACK IMMEDIATE

 

(If you want to give open transactions time to finish, you can set ROLLBACK AFTER 60)

 

Make sure to drop any other snapshots first

Drop Snapshot: