there is a way to script this so that we can set the proper owners for databases in case of disaster recovery.
SELECT D.name AS 'Database', P.name AS 'Owner'
FROM sys.databases D
JOIN sys.server_principals P
ON D.owner_sid = P.sid
--where P.name <> 'sa'
ORDER BY D.name;
No comments:
Post a Comment