How to get a list of all users with dbo privilege?

  • Any input will be greatly appreciated.

  • sp_helprolemember will list all role members in the current database. sp_helpsrvrolemember will do it at the server level.

  • I found the way.

    EXEC sp_MSForEachDB 'USE ? SELECT name FROM sysusers WHERE sid = 0x01 AND name <> ''dbo'''

    But yours is better.

     

  • I'd be careful of that approach. I don't think it will give you all appropriate members of db_owner.

    At least its failing to find me on both my SQL 2000 and 2005 boxes.

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

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