Getting the current user in SQL Server stored procedure

Viewed 35548

I have a SQL Server 2008 Express R2 instance authenticating from Active Directory. Users have records associated with their AD account stored in a database. I would like to have stored procedures for them to retrieve their records.

So the procedure might make the query SELECT * FROM PurchaseOrders WHERE uid = $userid

How do I find out $userid, a property in their AD profile?

Thanks!

2 Answers
Related