Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Logging field changes in table using triggers or service broker Expand / Collapse
Author
Message
Posted Tuesday, November 27, 2012 4:37 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, May 29, 2014 9:53 AM
Points: 92, Visits: 275
When someone changes a value in a table I want to retain the old value(s) for a time in a log table. I could implement this as a trigger - is there any performance gain from implementing this using Service Broker? i.e. to offload some of the burden from the UPDATE query?

Thanks
Post #1389084
Posted Tuesday, November 27, 2012 5:20 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 4:34 AM
Points: 231, Visits: 740
I think triger is best solution in sql server 2005 ı used it about 20 million record table logging
but you can look at this

http://sqlblog.com/blogs/linchi_shea/archive/2012/01/24/performance-impact-sql2008-r2-audit-and-trace.aspx
Post #1389115
Posted Wednesday, November 28, 2012 6:41 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 8:53 AM
Points: 4,350, Visits: 6,162
This should be done with a properly coded trigger.

Best,

Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru at GMail
Post #1389722
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse