>>>Thanks Naomi. I was able to make this work with one addition of a space after #del d (and I almost understand your changes). :)
>>>
>>You're welcome.
>
>Naomi -
>
>Here is a follow-up question. The trigger we've been talking about is working fine. One of the fields in the audit table is the name of the user who made the change. If the edit is made via SSMS, the name is logged OK. However most of the interaction is made via a web app where the user is connecting via a generic connection string and is known only as 'webuser'. If the user is logged in via the membership, is there a way the trigger can identify who he is? I suspect not, but I thought it was worth asking. How do others deal with this?
>Thanks
No, unfortunately there is no way to get the actual user if the logging is done from the web using webuser.
If the web application knows the user (say, operator), it can try providing this info using CONTEXT_INFO. Try googling on this topic.
If it's not broken, fix it until it is.
My Blog