|
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
|