| title | View a Database Snapshot (SQL Server) | |||
|---|---|---|---|---|
| description | Learn how to view a SQL Server database snapshot using SQL Server Management Studio or Transact-SQL. | |||
| author | WilliamDAssafMSFT | |||
| ms.author | wiassaf | |||
| ms.reviewer | jopilov | |||
| ms.date | 05/04/2023 | |||
| ms.service | sql | |||
| ms.subservice | supportability | |||
| ms.topic | how-to | |||
| helpviewer_keywords |
|
[!INCLUDE SQL Server]
This article explains how to view a [!INCLUDEssNoVersion] database snapshot using [!INCLUDEssManStudioFull].
Note
To create, revert to, or delete a database snapshot, you must use [!INCLUDEtsql].
To view a database snapshot
-
In Object Explorer, connect to the instance of the [!INCLUDEssDEnoversion] and then expand that instance.
-
Expand Databases.
-
Expand Database Snapshots, and select the snapshot you want to view.
To view a database snapshot
-
Connect to the [!INCLUDEssDE].
-
From the Standard bar, select New Query.
-
To list the database snapshots of the instance of [!INCLUDEssNoVersion], query the
source_database_idcolumn of the sys.databases catalog view for non-NULL values. -
You can also use this query to get details about the database snapshot and its files
SELECT db_name(db.source_database_id) source_database, db.name AS snapshot_db_name, db.database_id, db.source_database_id, db.create_date, db.compatibility_level, db.is_read_only, mf.physical_name FROM sys.databases db INNER JOIN sys.master_files mf ON db.database_id = mf.database_id WHERE db.source_database_id is not null AND mf.is_sparse =1 ORDER BY db.name;