December 4, 2009 at 11:17 am
I have a trigger where I want to log the current Logged in user. Is there a server level variable that captures this info and if so what is it?
December 4, 2009 at 11:52 am
Let me refer you to Books On Line
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/e31254f1-6c41-4cbf-98b5-54daa7f81fd9.htm
and you can learn how to use the user's login name or user name.
December 4, 2009 at 11:56 am
That link is not an html link.
December 4, 2009 at 12:46 pm
Sorry about that link being faulty. Use books on line and search for:
CURRENT_USER (Transact-SQL)
Functions That Return User Names and User IDs
SESSION_USER (Transact-SQL)
USER (Transact-SQL)
USER_NAME (Transact-SQL)
Believe that one of these functions will return what you are looking for.
Again, sorry about that link being faulty.
December 4, 2009 at 12:47 pm
December 4, 2009 at 3:54 pm
Elliott W
Try this one:
The above link refers to SQL Server 2008 Books Online (October 2009)
and the user has posted his/her question to a SQL 2005 forum.
December 4, 2009 at 5:35 pm
suser_sname() - http://msdn.microsoft.com/en-us/library/ms174427%28SQL.90%29.aspx
user_name() - http://msdn.microsoft.com/en-us/library/ms188014%28SQL.90%29.aspx
There are related functions in those links as well. Pick the one that suits your needs.
December 7, 2009 at 8:13 am
bitbucket-25253 (12/4/2009)
Elliott W
Try this one:
The above link refers to SQL Server 2008 Books Online (October 2009)
and the user has posted his/her question to a SQL 2005 forum.
True but the differences are pretty marginal for this...
CEWII
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply