USER_NAME() is a function which return the user name of the current connected user.I tried the following:EXEC SP_HELPUSER[USER_NAME()]
This give me the error:Msg 15198, Level 16, State 1, Procedure sp_helpuser, Line 177The name supplied (USER_NAME()) is not a user, role, or aliased login.
I am writing a c++ program which will execute the above statement after the user logged on to the database. And, the database user name of some users may not same as their login name.So, how to execute SP_HELPUSER by passing value returned by USER_NAME() function as argument?(optional)Is it possible to do this in single line statement?