Created
September 14, 2019 04:20
-
-
Save ThangLeQuoc/dd2fe45d411efa6f636a44bce35546c7 to your computer and use it in GitHub Desktop.
SQL Server - List owners of databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- list database and owner id | |
SELECT SUSER_NAME(owner_sid), * FROM sys.databases; | |
-- view login creation date | |
SELECT * | |
FROM master.sys.sql_logins; | |
-- view database | |
SELECT * | |
FROM master.sys.databases; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment