views:

1394

answers:

1

In sql server 2005 , inside an update trigger is there a way to find the list of fields\columns those are modified by the original update query.

I have a table with 150 columns and inside the trigger need to konw if ONLY one particular field was updated or not ( and no-other field was modified )

I can write a long sql to compare 150 columns but it will be error prone and look stupid!

Any decent way of getting around this problem. I am hoping some sql2005 api will come to my rescue.

+6  A: 

Take a looksie at COLUMNS_UPDATED - it's a bit of a pain, but you should be able to work with it quite easily for your requirement. There's a decent article about it on SQL Server Central.

Steven Robbins
Works! Thanks for a quick response!!!
dotnetcoder