>I have pondered this question before but never found a satisfactory answer. Perhaps someone can help now. I and reworking an old app to make it available on the web via .NET. The DBC has a stored procedure that logs before and after values when any edits are made to the tables. The SP is triggered via triggers in the tables so it is all automatic. In addition to the edit info the log keeps the date and time and the username of the person making the edit. Username is provided by a public variable initiated at logon. In the web app the username will be stored in a session variable in a similar fashion. My question is . . . What modifications will I need to make to enable the same logging from the web app? IE Will I have to drop the triggers in order to pass the username explicitly? How can I pass the username to the SP if the triggers are still in place? etc.
>
>Any advice/insights will be appreciated.
>Thanks
Use T-SQL functions instead. See
http://forums.asp.net/t/1347817.aspxActually, this is not going to work, I take it back.
In the trigger code you can access just updated info using new OUTPUT clause in SQL Server 2005. Research on this.
If it's not broken, fix it until it is.
My Blog