Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 2.72 KB

view-a-database-snapshot-sql-server.md

File metadata and controls

72 lines (54 loc) · 2.72 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic helpviewer_keywords
View a Database Snapshot (SQL Server)
Learn how to view a SQL Server database snapshot using SQL Server Management Studio or Transact-SQL.
WilliamDAssafMSFT
wiassaf
jopilov
05/04/2023
sql
supportability
conceptual
database snapshots [SQL Server], viewing
displaying database snapshots
viewing database snapshots

View a Database Snapshot (SQL Server)

[!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].

Use SQL Server Management Studio

To view a database snapshot

  1. In Object Explorer, connect to the instance of the [!INCLUDEssDEnoversion] and then expand that instance.

  2. Expand Databases.

  3. Expand Database Snapshots, and select the snapshot you want to view.

Use Transact-SQL

To view a database snapshot

  1. Connect to the [!INCLUDEssDE].

  2. From the Standard bar, select New Query.

  3. To list the database snapshots of the instance of [!INCLUDEssNoVersion], query the source_database_id column of the sys.databases catalog view for non-NULL values.

  4. 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;

Related Tasks

Next steps