Understanding Database Snapshots in SQL Server

Database snapshots are static, read-only “pictures” of your database at a particular point in time. Available in SQL Server Enterprise Edition, they capture the database's state but do not replace backups.

Analogy 1

Imagine taking a screenshot of a text document. No matter how much you edit the document, the screenshot doesn’t change. Similarly:

SQL Syntax

CREATE DATABASE <snapshot_name>
ON ( NAME = <logical_data_filename>,
FILENAME = '<path_to_snapshot_file>' )
AS SNAPSHOT OF <database_name>;

RESTORE DATABASE <database_name>
FROM DATABASE_SNAPSHOT = '<snapshot_name>';

Key Features

Advantages

  • Fast to create
  • Easy rollback
  • Low disk usage

Disadvantages

  • Read-only
  • Depends on original DB
  • Not portable or a true backup

Use Cases

Analogy 2 - Game Save Points

Think of snapshots as save points in a video game. You save your progress after level 5 and continue playing. If you fail at level 8, you can revert to the level 5 save — but the save itself never changes. If the game crashes, you lose both the game and the save point — unless you made a backup of the whole game.

🤔 Why are snapshots not backups?

Features of Backups

🚫 Can You Edit Snapshots?

No. Snapshots are read-only by design. You can query them but cannot update, delete, or insert. If you need to make changes, restore the database from the snapshot and save a new one.