How do I list Permissions for DB roles in Query Analyser.

  • What I am really trying to do is create a script that will list all permissions for any role that doesn't start with db_ on every database.

    Does anybody have something like that?

    Could you point me in the right direction for a loop that will execute a statement for each database in an instance?

    I found a great script on this sight for the main part of my problem!!  This site is awesome.

    http://www.sqlservercentral.com/scripts/contributions/1080.asp

    So i am still clueless for setting up a looping structure to run this sp on each of the databases.

  • Here's a routine that executes the same command for all databases in an instance.  You should be able to modify it to plug in your commands.

    declare @sql varchar(400)

    set @sql='select ''?''as dbname;select name, fileid, filename from ?.dbo.sysfiles'

    exec sp_msforeachdb @sql

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • You may also want to check out:  sp_helplogins

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply