How to set a default value for an existing column
Syntax:
ALTER TABLE [TableName] ADD CONSTRAINT [ContraintName] DEFAULT 'Value' FOR [ColumnName];Example:
ALTER TABLE EmpMaster ADD CONSTRAINT Test DEFAULT 'Pune' FOR City;
OOPS Concepts, OOPS interview questions, C#.Net interview questions, .Net framework interview questions, Asp.Net interview questions, SQL server interview questions, WCF interview questions, WPF interview questions, Angular Js interview questions
Syntax:
ALTER TABLE [TableName] ADD CONSTRAINT [ContraintName] DEFAULT 'Value' FOR [ColumnName];Example:
ALTER TABLE EmpMaster ADD CONSTRAINT Test DEFAULT 'Pune' FOR City;
No comments:
Post a Comment