Subject Constraint Irregularity
Author Jason Dodson
Ok, first thing, DON'T ask me WHY I am doing this.

Anyway, I found a peculiarity with adding a check constraint to a varchar field I had. If I declare a check constraint:

Alter Table MyTable
Add Constraint MyConstraint Check (MyField <> '');

Seems simple enough. I want no empty stings in this field. Only NULL or a real value. The problem is, trying to insert a
NULL into MyField will cause a constraint violation... like it, for that moment, can't tell the difference between a
NULL and an empty string. Now if I modify the check constraint to look like this:

Alter Table MyTable
Add Constraint MyConstraint Check (MyField <> '' or MyField Is Null);

Everything works peachy. Obviously it is unclear as to why I need the supplemental "or MyField is Null". Any incite
would be appreciated. If it turns out to be a bug, Ill file a report.

Jason

--
The information transmitted herewith is sensitive information intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.