I have connected to a Datamart via SSMS. Behind the Datamart is an Azure SQL database.
I am trying to find out my username. I used the following query:
SELECT USER_NAME();
I get this error:
Unsupported sql function USER_NAME. Line:1, Position:8
I have combed the internet but I have not come across something that works yet.
CodePudding user response:
in MS SQL SERVER you must use
SELECT CURRENT_USER;
or to get the windows user mame of the logged in user
SELECT SUSER_NAME() LoggedInUser