• christopher.cormier (6/9/2010)


    This may be a faily easy quesion, but aside from the business requirement are there any performance benefits of putting the audit trail in a trigger? I'm fairly new to SQL, but if the only way for users to delete a record is to use the mentioned stored procedure I think I would leave the audit trail piece in the procedure itself.

    Are there any performance/security benefits of using triggers for audit trails?

    Thanks!

    One reason for having it in a trigger is to cover instances where the SP is bypassed.

    You could use an instead of so that if the info was missing then the deletion did not take place.

    Alternatively you could record suser_sname() if the user info was missing though of a web app this woudl be less useful.

    [font="Arial"]_______________________________________________________
    Change is inevitable... Except from a vending machine.[/font]