現(xiàn)在,讓我們來看看數(shù)據(jù)庫快照在SQL Server 2005中是如何工作的。為此,首先我需要一個源數(shù)據(jù)庫作為快照的來源。下面的腳本將創(chuàng)建一個源數(shù)據(jù)庫:
USE master GO IF EXISTS(SELECT name from sysdatabases where [name] = 'SourceDatabase') DROP DATABASE SourceDatabase GO CREATE DATABASE SourceDatabaseON PRIMARY ( NAME = SourceDatabase_Data, FILENAME = 'C:SQLServerSourceDatabase_Data.mdf' ) LOG ON ( NAME = SourceDatabase_Log, FILENAME = 'C:SQLServerSourceDatabase_Log.ldf' ) GO