Asynchronous Triggers in SQL Server 2005/2008

后端 未结 10 1045
-上瘾入骨i
-上瘾入骨i 2020-12-08 09:51

I have triggers that manipulate and insert a lot of data into a Change tracking table for audit purposes on every insert, update and delete.

This t

10条回答
  •  生来不讨喜
    2020-12-08 10:27

    I suspect that your trigger is of of these generic csv/text generating triggers designed to log all changes for all table in one place. Good in theory (perhaps...), but difficult to maintain and use in practice.

    If you could run asynchronously (which would still require storing data somewhere for logging again later), then you are not auditing and neither do have history to use.

    Perhaps you could look at the trigger execution plan and see what bit is taking the longest?

    Can you change how you audit, say, to per table? You could split the current log data into the relevant tables.

提交回复
热议问题