August 13, 2025 at 12:00 am
Comments posted to this topic are about the item Determining the Updated Columns
August 13, 2025 at 2:07 pm
IF UPDATE(CreditLimit)
That approach seems preferable to me, unless you really have to use COLUMNS_UPDATED()
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
August 14, 2025 at 10:42 pm
All depends on the use case. One might work better than the other, or one might not work
August 16, 2025 at 3:31 am
COLUMNS_UPDATED() will tell you which columns had an update attempted but it will not tell you if a value actually changed.
Also, I'm in favor of the clarity of IF UPDATED(CreditLimit) like Scott pointed out. I'd also add code to compare the values of the INSERTED and DELETED values on this column to determine if the was really a value change or not.
And Welcome Back!!!
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply