Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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: 2231 | Views in the last 30 days: 3
 
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