the column filtering solution is incomplete. consider this update statement:
update tableA set name ='Jane',contactnumber='baddata' where id=8
since column(name) comes up true, it still executes. column() doesn't mean only that column, just that it has to be included.
here's some logic i've used to make sure that the number of columns matches what i want:
declare @mc int
set @mc=0
declare @cu int
set @cu=columns_updated()
while @cu>0
begin
if (@cu & 1)>0
begin
set @mc=@mc+1
set @cu=@cu-1
end
set @cu=@cu/2
end
if @mc=1 and update(name)