views:

165

answers:

4

Hi all,

I have a condition where in a trigger should be invoked whenever a particular column gets updated in a table but not when any other column gets updated. Is it possible?

+1  A: 

Your trigger gets invoked on any update, but you can add some checking to process data only when your column has new value.

Riho
A: 

Hi, trigger has only tree options ON INSERT, UPDATE, DELETE this means trigger will ge fired on every update command no mater what column is updated Best Regars, Iordan

IordanTanev
+1  A: 

http://benreichelt.net/blog/2005/12/13/making-a-trigger-fire-on-column-change/

Winterwheat
+!!!! genius!..
Andreas Niedermair
+2  A: 

A trigger gets invoked regardless of the fields changed, however you can use

IF UPDATE(mycol)
BEGIN
    -- logic goes here
END

to implement logic for a specific column.

Also take a look at COLUMNS_UPDATED function too.

Miles D