Constraints and rules used with null values

You cannot define a column to allow null values, and then override this definition with a constraint or a rule that prohibits null values. For example, if a column definition specifies NULL and a rule specifies:

@val in (1,2,3)

An implicit or explicit NULL does not violate the rule. The column definition overrides the rule, even a rule that specifies:

@val is not null

See “Defining integrity constraints for tables” for more information on constraints. Rules are covered in detail in Chapter 14, “Defining Defaults and Rules for Data.”