Monday, 2 July 2018

Logging just the columns you are interested in

So you want to log the changes to a table in MS SQL Server, but you are only interested in some columns.

Writing some SQL to compare the updated and inserted tables in a TRIGGER using ORs might seem the way to go, but its really, really slow.

I found this better solution on stackoverflow and I really like the readability and speed.