[dba-SQLServer] Audit table - How to capture user who deleted record

Dan Waters dwaters at usinternet.com
Wed Oct 28 12:08:42 CDT 2009


Hi Betsey,

If people are logging in with a user name and password, then you can use
'CurrentUser'.  This is an access function.

Otherwise, you can get the PC Name that someone is using with this function:
'Environ("ComputerName")'.

Good Luck!
Dan`

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Powlen,
Betsy
Sent: Wednesday, October 28, 2009 11:54 AM
To: dba-sqlserver at databaseadvisors.com
Subject: [dba-SQLServer] Audit table - How to capture user who deleted
record

Hello everyone,
I'm creating an audit table for our application. I had no problem with
the trigger for an insert or update, but when a user deletes a record I
can't figure out how to capture that user. 
I can't use system_user, that only shows the user name we created to
access the application.
Any ideas?
 
Betsy Powlen
Stanley Associates
3800 Fettler Park Drive
Dumfries, VA  22025
Office: (703) 441-4965
Cell:    (540) 498-0836
betsy.powlen.ctr at usmc.mil <blocked::mailto:betsy.powlen.ctr at usmc.mil> 
betsy.powlen at stanleyassociates.com
 
 
_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list