Re: How to detect a login under windows security?

From: Mike Epprecht \(SQL MVP\) (mike_at_epprecht.net)
Date: 10/01/05


Date: Sat, 1 Oct 2005 21:29:34 +0200

Hi

SELECT SUSER_SNAME()

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

"nospam@tgylnospam.no" <nospamtgylnospamno@discussions.microsoft.com> wrote
in message news:E126A1B3-179D-405A-8E57-55BE76F669CB@microsoft.com...
>I have a SQL Server 2000 on an intranet with windows security. A stored
> procedure is called every time users add orders into table ORDERS.
>
> How can I detect the login name and domain for the user that adds a new
> order? What would the lines of code look like in the stored procedure?
>
> Regards
>
> Tore G.



Relevant Pages