Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Quick snapshot

By Igor Micev,

Snapshot script:
The script enables a quick creation of snapshots for databases. 
It has two run modes defined by the optional parameter @exec_mode.
 @exec_mode=0 (default) means printing the create snapshot statment and
 @exec_mode=1 means creation of the snapshot database.
 @database is mandatory input parameter.
Tested on SQL Server 2005, 2008, 2012.
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'AdventureWorksDW2012'
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'AdventureWorksDW2012', @exec_mode=0
EXEC [dbo].[Create_UserDb_Snapshot] @database = 'CWNET', @exec_mode=1
Date created: 2014-Mar-12
Author: Igor Micev (;

Total article views: 1763 | Views in the last 30 days: 9
Related Articles

Problems in creating database snapshots

Problems in creating database snapshots


Create Snapshot Dynamicly

Create Snapshot Dynamically considering multiple database files


Creating a Database Snapshot.

Creating a Database Snapshot, without space in disk.


Creating a Database Snapshot

Performance with databases Snapshots.


Database SnapShot

Database SnapShot


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones