Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Collapse DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Expand CreateCreate
     

Snapshot Database

 
      USE master
      GO

      
---- Drop Database Snapshot if it already exists
IF EXISTS ( SELECT name FROM sys.databases WHERE name = N'myDB_Snapshot_ID' ) DROP DATABASE myDB_Snapshot_ID GO
---- Create the Database Snapshot
CREATE DATABASE myDB_Snapshot_ID ON ( NAME = myDB, FILENAME = 'C:\path\myDB_Snapshot_ID.ss' ) AS SNAPSHOT OF myDB; GO