View Single Post
Old 11-07-2012, 11:05 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Oops...forgot: My table was created thus:
Code:
CREATE TABLE t ( a INT NOT NULL, b INT NOT NULL DEFAULT 0 );
the trigger did not work if b did not have a default value.

But by doing it this way, the trigger effectively overrides the default value, so the default value is of no consequence.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote