sample1
Ten Centuries
Points: 1197
More actions
June 6, 2005 at 2:29 am
#110456
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.
binu john
SSCommitted
Points: 1987
June 7, 2005 at 5:41 am
#563446
select name from sysusers
Regards
Binu John
Ananda Kumar
Points: 1865
June 7, 2005 at 6:54 am
#563479
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.
vadba
SSChampion
Points: 11133
June 7, 2005 at 7:32 am
#563496
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