Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    25

    Unanswered: sql statement to get all users of a db, not of the server

    Hi,

    how can i get all users of Database? Not of the complete sql server?
    Is there a sql statement?

    Can i get the roles or properties of these users too?

    Thanx a lot,

    Crean

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    use [database]
    sp_helpuser


    or

    use [database]
    select * from sysusers

    Not that the 2nd method relies on selecting from a system table. This is not a recommended best practice as these tables are subject to change without notice.

    Your mileage may vary.

    Regards,

    hmscott


    PS. check out sp_helprolemember too. SQL BOL.
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •