users stored in database

  • Dear All,

    is there any way to run qurey tell me the users stored in the database.

    thanks alot.

  • you can use the old backwards compatible sysusers view or the newer sys.sysusers view in 2005 and above:

    select * from sysusers

    select * from sys.sysusers

    that is different fromt he logins that exist on the server:

    select * from sys.syslogins

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (1/21/2010)


    you can use the old backwards compatible sysusers view or the newer sys.sysusers view in 2005 and above:

    sysusers and sys.sysusers refer to the same view, a backward compatibility view included, but deprecated. (dbo.sysusers works too, and refers to the same view.)

    The 2005 replacements is sys.database_principals

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks Gail!

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Yaa !

    There two System Views

    1. sys.Server_Principals for Logins (saved in master database)

    2. sys.Database_Principals for Users (saved in each user database)

    Ram
    MSSQL DBA

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

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