Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Antinsh
Starting Member
16 Posts |
Posted - 2008-03-19 : 08:34:36
|
| What function returns name of the user that executes stored procedure?The body of procedure is something like this:UPDATE myTableSET data1=@data1,data2=@data2,userWhoDidThis=???WHEREid=@id |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-19 : 08:40:02
|
| [code]UPDATE myTableSET data1=@data1,data2=@data2,userWhoDidThis=current_userWHEREid=@id[/code]Edit: You can also use USER_NAME()Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|