dboardwine
SSC Rookie
Points: 30
More actions
July 29, 2005 at 8:25 am
#90456
Hello all,
I'm looking for a script that will query the system tables and return all of the database names and their respective owners.
TIA
DavidB
Roy Rogers
SSCertifiable
Points: 7712
July 29, 2005 at 8:41 am
#578201
select db.[name] [database], l.[name] [owner]
from
master.dbo.sysdatabases db
join
master.dbo.syslogins l
on
db.sid = l.sid
Regards,gova
July 29, 2005 at 8:50 am
#578204
Thank you. That is exactly what I needed.
Murthy-152277
Right there with Babe
Points: 720
August 1, 2005 at 9:43 am
#578583
Hi,
This is other way of getting all the DataBase Names ,that has permissions for the current User.
that has permissions for the current user.
Select CATALOG_NAME,SCHEMA_OWNER from INFORMATION_SCHEMA.SCHEMATA
Thanks,
Murthy.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply