How to Find The Database Owner Using TSQL

When you select the “owner_id” column from the [sys.databases] table, to find out who is the owner of each database in your server, the value show in the column is unreadable, like a line of hex value.

Use the built in “SUSER_SNAME” function to convert the hex value to meaningful owner name. Execute the following scripts to find out who is the database owner for each databases.

SELECT name, SUSER_SNAME(owner_sid) AS [Owner_Name]
FROM sys.databases

Leave a Reply

Your email address will not be published. Required fields are marked *