Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column default value

Status
Not open for further replies.

mtawk

Programmer
Nov 6, 2001
26
IQ
Hello,
I have an existing column (NOT NULL) in a table with no default value and i want to update the column to set a default value for it.
I tried "ALTER TABLE xxx ALTER COLUMN yyy", but it didn't work.
I would appreciate any help.
thanks.
 
SQL server has a nonstandard syntax for setting a default value for an existing column

alter table tableName
add constraint constraintName
default 'defaultValueExpression'
for columnName

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top