Wednesday, 6 January 2016

What is a default constraint? SQL Server Interview Question

SQL Server Interview Question: What is a default constraint?
The DEFAULT constraint is used to insert a default value into a column.
The default value will be added to all new records, if no other value is specified.

CREATE TABLE Employee
(
     E_Id int NOT NULL,
     LastName varchar(255) NOT NULL,
     FirstName varchar(255),
     Address varchar(255),
     City varchar(255) DEFAULT 'Delhi'
)

Click here for more than 300 Sql server Interview questions
Visit Our New Site for HR Interview Questions Answers http://www.interviewboat.com/Company/GetCompany
Sponsored Ads

0 comments:

Post a Comment