locked
Database Role membership for MSDB database alone RRS feed

  • Question

  • Hi,

               I do like to find the query to list out all the available database role membership identities for msdb database. For other database i pull out the list of database role membership from sys.database_principals whose principal_id ranges between 16384-16393. For msdb database there seems to be much of database roles and it is not available in sys.database_principals. Kindly help me out in pulling out all the database roles for msdb database alone.

     

    Regards,

    Jeisurya

    Thursday, May 19, 2011 9:42 AM

Answers

  • Hallo Jeisurya,

    It is in msdb as it is in ALL databases. MSBD is "only" a database ;-).
    A statement concerning the uid is not the real solution. To check all roles you should approve TYPE or TYPE_DESC

    SELECT * FROM sys.database_principals WHERE type_desc = 'DATABASE_ROLE'
    

    Uwe Ricken

    MCIT Database Administrator 2005
    MCIT Database Administrator 2008
    MCTS SQL Server 2005
    MCTS SQL Server 2008, Implementation and Maintenance
    db Berater GmbH
    http://www-db-berater.de
    • Proposed as answer by WeiLin Qiao Tuesday, May 24, 2011 8:06 AM
    • Marked as answer by WeiLin Qiao Monday, May 30, 2011 12:12 AM
    Thursday, May 19, 2011 9:56 AM