Is there a way I can track just the columns that were changed in an update statement.
eg.
I have a table with 50 columns. I am writing a trigger to trap the changes made to that table. When three columns got changed I would like to get the new and old value of those three columns and populate a transaction table.
Now the only way I know is to get the values for all 50 columns and check whether the old and new values are different and then do an insert inot the transaction.
Instead of doing that, Is there a way where I can get only the names of the columns that got changed?
Thanks
eg.
I have a table with 50 columns. I am writing a trigger to trap the changes made to that table. When three columns got changed I would like to get the new and old value of those three columns and populate a transaction table.
Now the only way I know is to get the values for all 50 columns and check whether the old and new values are different and then do an insert inot the transaction.
Instead of doing that, Is there a way where I can get only the names of the columns that got changed?
Thanks