Search

Monday, February 18, 2013

Change the Default Value of a Column in already created Table

Use below method to alter or change the default value of a column of an existing table:


ALTER TABLE <Table_Name> DROP CONSTRAINT <Column_Constraint_Name>  
GO
ALTER TABLE <Table_Name> WITH NOCHECK   
ADD CONSTRAINT [<Column_Constraint_Name>] DEFAULT (-10) FOR <Column_Name>

No comments:

Post a Comment