|
Posted by Erland Sommarskog on 08/08/06 21:41
Eric Bragas (ericbragas@yahoo.com) writes:
> I see the following in Books Online: CONSTRAINT--Is an optional keyword
> indicating the beginning of a PRIMARY KEY, NOT NULL, UNIQUE, FOREIGN
> KEY, or CHECK constraint definition...
>
> But I have a table column defined as follows:
>
> [MONTH] [decimal] (2, 0) NOT NULL CONSTRAINT
> [DF__TBLNAME__MONTH__216361A7] DEFAULT (0)
>
> My question: Is "DEFAULT" a constraint, or is it called something else?
There are actually two sorts of defaults: bound defaults and default
constraints. Bound defaults are deprecated, but are useful when you
bind them to types.
What you have above, is indeed a default constraints.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|