641
Chapter 24: Database Snapshots
24
FIGURE 24-4
Viewing the size of the database snapshot data fi le.
Querying Your Database Snapshots
After you create a database snapshot, users can query the database snapshot as if it were
a regular database. For example, the following query retrieves the Name, ProductNumber,
and ListPrice from the Product table in the AdventureWorks2012_Snapshot database
snapshot.
USE AdventureWorks2012_Snapshot;
GO
SELECT Name, ProductNumber, ListPrice
FROM Production.Product
ORDER BY Name ASC;
GO
The main difference is that users cannot make any updates to the database snapshot
because it is read-only. If users try to update the database snapshot, they receive
error 3906 as shown here:
Msg 3906, Level 16, State 1, Line 1
Failed to update database "AdventureWorks2012_Snapshot" because the
database is read-only.
c24.indd 641c24.indd 641 7/31/2012 9:25:49 AM7/31/2012 9:25:49 AM
http://www.it-ebooks.info