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.
Usage:
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 (igor.micev@hotmail.com; igor.micev@outlook.com)
*/

Total article views: 987 | Views in the last 30 days: 13
 
Related Articles
FORUM

Problems in creating database snapshots

Problems in creating database snapshots

SCRIPT

Create Snapshot Dynamicly

Create Snapshot Dynamically considering multiple database files

FORUM

Creating a Database Snapshot.

Creating a Database Snapshot, without space in disk.

FORUM

Creating a Database Snapshot

Performance with databases Snapshots.

FORUM

Database SnapShot

Database SnapShot

Tags
snapshot    
 
Contribute

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
Editor, SQLServerCentral.com

Already a member? Jump in:

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