Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger - Acquiring NT User ID

Status
Not open for further replies.

nj5j

Programmer
Oct 5, 2000
19
US
Within a trigger I need to identify a user via his NT User id but there is no system variable that provides this and instead provide the SQL Server logon.

Any ideas? [sig][/sig]
 
From the BOL:

If the current user is logged in to Microsoft® SQL Server™ using Microsoft Windows NT® Authentication, SYSTEM_USER returns the Windows NT login identification name, for example, DOMAIN\user_login_name. However, if the current user is logged in to SQL Server using SQL Server Authentication, SYSTEM_USER returns the SQL Server login identification name, for example, sa for a user logged in as sa.

You might also give HOST_NAME() a spin. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Robert,
HOST_NAME() is definitely the way to go.
Thank you for that suggestion.
Carl R. Perkins [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top