• damian.wise (5/3/2011)


    An excellent set of articles. Does anyone know how to return the extended properties of Database Roles in the same way?

    Damian

    Apply with:

    EXEC sys.sp_addextendedproperty

    @name=N'name',

    @value=N'value',

    @level0type=N'USER',

    @level0name=N'databaserole'

    Query with:

    SELECT *

    FROM sys.extended_properties AS xp

    INNER JOIN sys.database_principals AS dp

    ON xp.major_id = dp.principal_id

    AND xp.class_desc = 'DATABASE_PRINCIPAL'