Get the user name

  • Is any query to find the user name by mentioning the sid ?

  • SELECT name FROM sys.database_principals WHERE sid = ...

    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

  • SELECT SUSER_SNAME(0x01)

    Where 0x01 is the SID. This will give you the login name, i.e. at the server level.

    -----
    JL

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

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