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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find a current user name

Status
Not open for further replies.

Milleniumlegend

IS-IT--Management
Dec 16, 2003
135
How to find the current user name for the database.

many thanks
 
[red]sp_who[/red] will indicate the process id, login name, host name, db name, and command executing, etc.
 
Depending upon what you want, this may do what you need more effectively:

select suser_name()

That will give you the login name of the user executing the code.

select user_name()

gives you the name-in-db of the user executing the code.

HTH,

John


J M Craig
Alpha-G Consulting, LLC
nsjmcraig@netscape.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top