[SQL Server]Add NOT NULL Constraint in SQL Server
- Today I will explain about the different ways to add a NOT NULL constraint on a column.
Advantages of NOT NULL constraint:
1) You can prevent users to enter null values into this column.
2) The pre-requisite to enforce Primary Key on a Column.
Now Lets get into the details:
There are two ways which i can think of
1) While creating the table using CREATE TABLE statement.
2) Modifiying the table definition using ALTER TABLE statement.
Check out the below link for complete information with examples: