June 6, 2005 at 2:29 am
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.
June 7, 2005 at 5:41 am
select name from sysusers
Regards
Binu John
June 7, 2005 at 6:54 am
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.
June 7, 2005 at 7:32 am
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