MS SQL

SELECT SUBSTRING(UPPER(SUSER_SNAME()), PATINDEX('%\%', UPPER(SUSER_SNAME())) + 1, LEN(UPPER(SUSER_SNAME())) - PATINDEX('%\%',

UPPER(SUSER_SNAME()))) AS Cur_Nick