Log changes to database table with trigger

前端 未结 12 2292
醉梦人生
醉梦人生 2021-02-08 18:48

I am looking for a good way to log changes that occur on a particular set of tables in my SQL Server 2005 database. I believe the best way to do this is through a trigger that g

12条回答
  •  逝去的感伤
    2021-02-08 19:18

    Triggers are bad, I'd stay away from triggers.

    If you are trying to troubleshoot something, attach Sql Profiler to the database with specific conditions. This will log every query run for your inspection.

    Another option is to change to calling program to log its queries. This is a very common practice.

提交回复
热议问题