--How
to enlist all database snapshots in a sql server instance
 USE MASTER
         
SELECT  SourceDB.[name] AS SourceDatabase,
                 
SnapshotDB.[name] AS SnapshotDatabase,
 
                SnapshotDB.Create_Date AS DateOfCreation
         
FROM sys.databases SourceDB
         
INNER JOIN sys.databases SnapshotDB
         
ON SourceDB.database_id = SnapshotDB.source_database_id
--only enlist the snapshots:
--only enlist the snapshots:
SELECT * FROM sys.databases  where  source_database_id IS NOT NULL
  
Keine Kommentare:
Kommentar veröffentlichen