user name

  • HOw do i find a user name in a database if he is a dbo or guest user.

    Hint: the user name differs with its login.

  • select name from sysusers

    Regards

    Binu John

  • Thanks for your reply.

    Yes we can use sysusers. But User_id() will return always 1 if the currently logged in  user is dbo. Then the user name will be dbo, not the original name of the user.

  • How about:

    SELECT suser_sname()

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

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