Posted on 1998-09-25
The documentation for MS SQL7 recommends using check constraints rather than rules.
1. Can I impose a check constraint on a user-defined data type? If so how - add the syntax to this statement to force either 'Y','N', or '' as acceptable values:
EXEC sp_addtype yes_no, char(1), 'NULL'
2. In a table definition can a field-level check constraint refer to a field in a general lookup table (this is not a foreign key candidate)? If so please provide specific syntax.
3. Opinion only - why would a check constraint be preferable to a rule?