Changing the nullability of a domain
When you create a domain, you can optionally specify NOT NULL
and/or a CHECK
constraint:
create domain posint as int not null check (value > 0)
Domain constraints cannot be overridden or switched off at the column level, but they can be added to.For instance, you can create a nullable domain but specify NOT NULL
for certain columns based on that domain.Or you can define an additional CHECK
on the column level.But sometimes you may want to change the constraints for the entire domain after it has been used for a while.The following paragraphs show you how.