Avatar of eepdawg

asked on 

Loop through Fields in a Record in T-SQL


I am trying to implement the following Trigger into a table in SQL Server 2005

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.

Microsoft SQL Server 2005SQL

Avatar of undefined
Last Comment

8/22/2022 - Mon