Reputation: 598
I'm trying to create a Check Constraint using SQL Server Management Studio 2012's wizard to allow a field to be null only if the tuple is not enabled, but I'm getting an Error validating constraint
.
The expression I'm trying to use is this:
TransactionalMerchantId IS NOT NULL
OR
(TransactionalMerchantId IS NULL AND Enabled IS false)
My table is designed as this:
Can someone help me figure out why this is happening?
Upvotes: 0
Views: 771
Reputation: 1740
Try:
TransactionalMerchantId IS NOT NULL
OR
(TransactionalMerchantId IS NULL AND Enabled = 0)
Upvotes: 3