views:

1488

answers:

2

I know that SqlContext.WindowsIdentity returns the current user that is executing the command (in a CLR trigger), however, this only works for windows authenticated users. How do I get the username if it's a sql server user instead? Any help is appreciated.

+1  A: 

Try using SUSER_NAME() function in SQL server. This will return the current user.

Raj

Raj
A: 

Try using SYSTEM_USER.

SELECT SYSTEM_USER
Musikero31