table name to get the user details

  • Please let me know the table name where i can get information about the user like user name, login name, roles, privileges of a particular SQL server 2005 database

    Thanks

  • oK

    SELECT SU.name AS username, SL.dbname, SL.name AS loginname

    FROM sys.syslogins SL

    RIGHT OUTER JOIN sysusers SU

    ON SL.sid = SU.sid

    Add some other columns from syslogins table as per your requirement

    -LK

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

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