I am trying to add a check constraint to my table:
alter table ads
ADD CONSTRAINT
CK_ads_1 (not([ad_status] = 'approved, awaiting artwork files' and [approved_snapshot_id] = null))
ie approved_snapshot_id cant be null when the ad_status is 'approved, awaiting artwork files'
the constraint seems to 'save' properly, however the constraint just doesn't work. Is it because constraints ignore columns with null values? If so, is there an alternative way of solving my problem. Thanks.