Your query should do the job!
USER_NAME()
and
CURRENT_USER
should return the same, the name of user, which currently executes the statement.
More at:
CURRENT_USER (Transact-SQL) - SQL Server | Microsoft Docs[
^]
In case you wanted to get other answer, you need to explain what's worng with your code or what you want to achieve...
[EDIT]
Maciej Los wrote:
What system? Database (server) system or loacal computer system?
Member 15088142 wrote:
local computer system
To get local computer user name, use:
string currUser = Environment.UserName;
and pass it as a parameter into command ;)