DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

What is the DEFAULT constraint in SQL Server?

A DEFAULT constraint, like all constraints, becomes an integral part of the table definition. It defines what to do when new row is inserted that does not include data for the column on which you have defined the DEFAULT constraint. You can either define it as a literal value(like default salary to zero or UNKNOWN for a string column) or as one of several values such as GETDATE().
The main things to understand about a DEFAULT constraint are -

1. DEFAULTs are only used in INSERT statements- They are ignored for UPDATE and DELETE statements.
2. If any value is supplied in the INSERT then the default is not used.
3. If no values supplied the default will always be used.

0 comments:

Post a Comment

About this blog

Blog Archive

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Blog Archive

Search This Blog