You are here: Re: Is DEFAULT a constraint? « MsSQL Server « IT news, forums, messages
Re: Is DEFAULT a constraint?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация