NOT NULL

IGNORE NULL ??


This is an integrity constraint that allows the database table creator to prevent columns containing a null value.
Typically a null value represents a missing data item
To deny null values you can create a table with a NOT NULL constraint on a column.


Applying On Creation


CREATE TABLE MyProducts 
(
ProductID INTEGER
Price MONEY NOT NULL - is column cannot contain NULL
Description CHAR(40) NULL - this column can contain NULL
)


Applying After Creation

You must always specify the column type and size
If the size is omitted then the default maximum size is applied.


ALTER TABLE MyProducts 
ALTER COLUMN Price MONEY NOT NULL

You cannot add this constraint to a column that already contains null values





© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext