Pages

Men

rh

10/30/2013

Default Constraints in SQL Server

A Default Constraints enters a value in a column when one is not specified in an Insert statement. Default constraints enforces Domain integrity.

Consider the following facts before you implement a Default Constraints.
  • A Default Constraints applies only to Insert Statement.
  • Each column can have only one Default Constraint.
  • Column with IDENTITY property or the Row Version data type can not have a default constraints placed on them.
  • A Default Constraints allows some system supplied values or User. (CURRENT USER,SESSION_USER, SYSTEM_USER OR CURRENT _TIMESTAMP)

When to use  DEFAULT CONSTRAINTS?
  • The data stored in a column has an obvious default value.
  • The column does not accept null values.
  • the column does not enforce unique values.



No comments :

Post a Comment