NOT NULL column and NULL column : Constraints Basics « Constraints « SQL Server / T-SQL






NOT NULL column and NULL column


1> CREATE TABLE MyTable
2>      ( Category nVarChar(50) NOT NULL
3>    , MyDescription nVarChar(50) NULL
4> )
5>
6>
7> INSERT MyTable (Category) VALUES ('Category1')
8>
9> SELECT * FROM MyTable
10> GO

(1 rows affected)
Category                                           MyDescription
-------------------------------------------------- -----------------
Category1                                          NULL

(1 rows affected)
1>
2> drop table MyTable
3> GO
1>
           
       








Related examples in the same category

1.Enable a column to optionally not require a value by designating it as a nullable column