How to find SQL Server database owner for all databases


SQL Server recommends ‘sa’ as database owner for all sql server databases. Where as when you create sql database it takes your login as database owner by default.
Its DBA’s responsibility to regularly audit sql databases and make sure there owner is sa.

Below is quick scripts to find database owner for all SQL Server databases.

/********************************************/
SELECT suser_sname( owner_sid ) as db_owner, name FROM sys.databases
/********************************************/






No comments:

Post a Comment