script to find owner of the databases -sql server | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

script to find owner of the databases -sql server

Hi 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
sp_helpdb.
sp_helplogins.
Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
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
go
select name as LoginName, dbname as DefaultDB from syslogins
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

]]>