Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

display permissions with database name Expand / Collapse
Author
Message
Posted Saturday, November 7, 2009 6:13 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 26, 2012 10:54 AM
Points: 18, Visits: 197
Hello,

I am running the following:

sp_msforeachdb @command1= "PRINT '?' EXEC ?.dbo.sp_helprolemember db_owner"


this is providing me the correct results but I am unable to get it to display the database name with the result set?
I would like to have something showing the Database name above then the permissions below each name for each result.

DatabaseName
DbRole MemberName MemberSID
db_owner dbo 0x01


My issue is I need to generate a report for Auditing that shows every DB with each user that has DBO rights to that DB. If I can get that in a single report that would be even better.

Thanks,
Post #815394
Posted Saturday, November 7, 2009 10:02 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, July 26, 2012 10:54 AM
Points: 18, Visits: 197
I"m able to get the results with:

sp_msforeachdb @command1= "USE ? select '?' EXEC ?.dbo.sp_helprolemember db_owner"


Post #815449
Posted Monday, November 9, 2009 2:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 1:07 AM
Points: 32, Visits: 472
Try Below Query..


sp_msforeachdb @command1= "select '?' as Databasename EXEC ?.dbo.sp_helprolemember db_owner"


Rd,
Deepali
Post #815676
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse