aparfitt
asked on
SQL Server equivalent to Access's Environ("Username")
I have tried SUSER_SNAME and System_user but they return the domain name as well as the user name.
Does anyone know how to get just the user name?
Thanks.
Does anyone know how to get just the user name?
Thanks.
try using Replace function or Left and Right functions to get just the domain name
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
actually here:
SELECT PARSENAME(REPLACE(SUSER_SN AME(),'\', '.'),1)
SELECT PARSENAME(REPLACE(SUSER_SN
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.