check user sql server code example
Example 1: sql server get users
select * from master.sys.server_principals
Example 2: t SQl Checking Your Username
ORIGINAL_LOGIN(), CURRENT_USER
SYSTEM_USER;
SELECT ORIGINAL_LOGIN(), CURRENT_USER, SYSTEM_USER;