|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
IF UPDATE ( column)hello everyone,
the documentation doesnt specify so i'm just gonna guess, but how would i specify multiple columns using the if update syntax IF UPDATE (Column) is documented i'm gonna try IF UPDATE (Column1, Column2) hope it works ty IF UPDATE(Column1) AND UPDATE(Column2)
Show quote "Abraham Andres Luna" <a**@rdk.com> wrote in message news:%23K$U%23a7FGHA.216@TK2MSFTNGP15.phx.gbl... > hello everyone, > > the documentation doesnt specify so i'm just gonna guess, but how would i > specify multiple columns using the if update syntax > > IF UPDATE (Column) > > is documented > > i'm gonna try > > IF UPDATE (Column1, Column2) > > hope it works > > ty > Probably the only way is to use
IF COLUMNS_UPDATED Show quote "Abraham Andres Luna" wrote: > hello everyone, > > the documentation doesnt specify so i'm just gonna guess, but how would i > specify multiple columns using the if update syntax > > IF UPDATE (Column) > > is documented > > i'm gonna try > > IF UPDATE (Column1, Column2) > > hope it works > > ty > > > I would check inserted with deleted tables
If you do this update table set value = 500 where value = 500 then the IF UPDATE part will fire anyway even though the value hasn't changed http://sqlservercode.blogspot.com/ I wouldn't recommend this - multiple UPDATE()s in are much cleaner and
easier to read. Plus, if the column order ever changes, you'll have to remember to redo the trigger. Daniel P. wrote: Show quote > Probably the only way is to use > IF COLUMNS_UPDATED > > "Abraham Andres Luna" wrote: > > >>hello everyone, >> >>the documentation doesnt specify so i'm just gonna guess, but how would i >>specify multiple columns using the if update syntax >> >>IF UPDATE (Column) >> >>is documented >> >>i'm gonna try >> >>IF UPDATE (Column1, Column2) >> >>hope it works >> >>ty >> >> >> |
|||||||||||||||||||||||