The blog has moved to the new site F10Debug.com

Wednesday, August 26, 2015

How to set a default value for an existing column

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;

No comments:

Post a Comment