Question : Adding a user name stamp to a SQL table

I have a table that logs data by region, but I need to be able to insert the user name who's creating new records.  I currently use AD to give acces to the database, how can I insert the user name on the table for each record that's created?

Answer : Adding a user name stamp to a SQL table

Since you are connecting to the db as a static sql user, you will need to grab the user from the process that is calling the insert command and pass the userinfo to the insert command or stored procedure. This of course will require you to update the insert statement or stored procedure.
Random Solutions  
 
programming4us programming4us