EXEC
sp_MSforeachdb 'EXEC [?]..sp_changedbowner ''sa'' '
Posts mit dem Label MS SQL Server werden angezeigt. Alle Posts anzeigen
Posts mit dem Label MS SQL Server werden angezeigt. Alle Posts anzeigen
Freitag, 31. Juli 2015
Montag, 29. Juni 2015
Find all database snapshots related to a database
--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
Labels:
database snapshot,
MS SQL Server,
T-SQL
Abonnieren
Posts (Atom)