tsunami

log in
history

SQL2005: Ways to get user name

Luke Breuer
2017-10-10 01:00 UTC

print user_name()
print session_user
print current_user
print user
print original_login()
print suser_sname()
print system_user
select  user_name = user_name(),
        [current_user] = current_user,
        [user] = user,
        [session_user] = session_user,
        user_id = user_id(),
        database_principal_id = database_principal_id(),
        suser_id = suser_id(),
        suser_sname = suser_sname(),
        suser_name = suser_name(),
        [system_user] = system_user,
        original_login = original_login(),
        suser_sid = suser_sid()