Mar 16, 2005 #1 Milleniumlegend IS-IT--Management Joined Dec 16, 2003 Messages 135 How to find the current user name for the database. many thanks
Mar 30, 2005 #2 babeo Technical User Joined Mar 30, 2000 Messages 398 Location CA [red]sp_who[/red] will indicate the process id, login name, host name, db name, and command executing, etc. Upvote 0 Downvote
[red]sp_who[/red] will indicate the process id, login name, host name, db name, and command executing, etc.
Apr 1, 2005 #3 JMCraig Programmer Joined Feb 20, 2002 Messages 217 Location US 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 http://www.alphagconsulting.comnsjmcraig@netscape.net Upvote 0 Downvote
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 http://www.alphagconsulting.comnsjmcraig@netscape.net