SELECT A.name,
CASE
WHEN B.mirroring_state IS NULL THEN 'Not in Mirroring'
ELSE 'In Mirroring'
END AS MirroringState
FROM sys.databases A
INNER JOIN sys.database_mirroring B
ON A.database_id = B.database_id
WHERE a.database_id > 4
ORDER BY A.name
No comments:
Post a Comment