Avatar of eepdawg
eepdawg

asked on 

Loop through Fields in a Record in T-SQL

Hello,

I am trying to implement the following Trigger into a table in SQL Server 2005
http://jamesewelch.wordpress.com/2007/09/04/tracking-database-record-changes-at-the-field-level/

I want to modify this example so not only does it check the Field in question but any field in the record...

So if we have 100 fields, the trigger will loop through all fields and check for changes and log it into the Change Log table.  I don't want to reference the actual field name anywhere -- just use something like column[i] with a while or for loop...

It has to be in T-SQL because I want to keep all the code in the trigger.

Thanks!
Microsoft SQL Server 2005SQL

Avatar of undefined
Last Comment
eepdawg

8/22/2022 - Mon