SQL Server Performance Forum – Threads Archive
script to find owner of the databases -sql serverHi Folks,
I am looking for a script to find owners of the databases in sql server 2000/2005 and also the logins in sql server.
Thanks in Advance
SQL-Server-Performance.com All in Love is Fair
All postings are provided â€œAS ISâ€ with no warranties for accuracy.
select d.name, l.name from sysdatabases d
join syslogins l on d.sid = l.sid
select name as LoginName, dbname as DefaultDB from syslogins
SQL-Server-Performance.com All postings are provided â€œAS ISâ€ with no warranties for accuracy.