Creating a simple Trigger - I have never used or written one before

Creating a simple Trigger - I have never used or written one before

 

  

I need to create a trigger that ensures that 1 and only 1 field in one
of my tables is ever set to "1" or true.
(and I'm using a varchar for that field not a boolean..if that
matters??)

So I have a table called "Properties" and a field in that called
"TopProperty". I want to create a trigger to ensure that

no matter how many records are added to this table, that only 1 record
at any one time ever has the value of "1" in the

"TopProperty" field. That field will only be explicitly set on an
OnClick event.

any help would be greatly appreciated.

Thanks,
Gabe

MS Sql Server LazyDBA home page