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 |
|
Brittney10
Posting Yak Master
154 Posts |
Posted - 2011-05-09 : 14:26:51
|
| Is there a way to capture a username in SQL and write it to a record. I want to be able to tell who updated or added a record in a field called "modified_by." Are there any built-in objects i can pull to get this? |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-05-09 : 14:38:00
|
| try system_user==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-05-09 : 14:38:34
|
| Take your pick:CURRENT_USERSESSION_USERSYSTEM_USERUSER_NAME()SUSER_SNAME()ORIGINAL_LOGIN()All these functions are documented in Books Online, you should read up on them to decide which is best for you. |
 |
|
|
|
|
|