Designating Default Column Values: Assign Zeroes Instead of Null Values : Default « Constraints « SQL Server / T-SQL Tutorial






6> CREATE TABLE T (
7>     int1 int,
8>     bit1 bit NOT NULL DEFAULT 0,
9>     varchar1 varchar(3),
10>     dec1 dec(5,2),
11>     cmp1 AS (int1 + bit1)
12> )
13> GO
1>
2> drop table t;
3> GO








7.6.Default
7.6.1.The syntax for defining a default
7.6.2.DEFAULT Constraints
7.6.3.Default int type value and default char type value
7.6.4.Using the system date as a default parameter.
7.6.5.Column with default random value
7.6.6.Insert to a table with default value
7.6.7.Designating Default Column Values: Assign Zeroes Instead of Null Values
7.6.8.Dropping Defaults