SQL Server Exclusive Or in check constraint

It took a little searching to figure out how to do an "exclusive or" in a check constraint. Here you go, you're welcome:

(IsNull([ColA],[ColB]) Is Not Null And ([ColA] Is Null Or [ColB] Is Null))

Technorati Tags: ,

posted @ Thursday, January 24, 2008 4:12 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 2 and 5 and type the answer here:
 

Live Comment Preview: