Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to get the AD UserName (or SSID) within a SP

Author  Topic 

nachtschicht
Starting Member

8 Posts

Posted - 2010-09-16 : 06:56:50
Hi,

is there a way to get the AD UserName or even better the SSID of an user executing a stored procedure on an MSSQL 2008 R2 Server. (Windows authentication).

Thanks for your help

:: www.Security-Blog.eu
:: www.MCSEboard.de

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-09-16 : 07:11:51
USER_NAME()
SUSER_SNAME()

and others... Please consult Books Online for more information.


N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-16 : 12:36:25
also
CURRENT_USER

if you want id use

USER_ID

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -