How to create a snapshot a database in SQL Server

We can use the CREATE DATABASE SQL statement in conjunction with AS SNAPSHOT AS statement to create a snapshot of a database.

Here is the example :

CREATE DATABASE SampleDBSnapShot ON
(NAME = 'SampleDBPrimary', FILENAME = 'D:\backup\SampleDBPrimary.mdf'), (NAME = 'SampleDBdata1', FILENAME = 'D:\backup\SampleDBData1.ndf'), (NAME = 'SampleDBdata2', FILENAME = 'D:\backup\SampleDBData2.ndf')
AS SNAPSHOT OF SampleDB



Ebook Download
View all
Learn
View all