Alter column, add default constraint

后端 未结 6 2104
臣服心动
臣服心动 2020-12-07 16:21

I have a table and one of the columns is \"Date\" of type datetime. We decided to add a default constraint to that column

Alter table TableName
alter column         


        
6条回答
  •  臣服心动
    2020-12-07 16:54

    You're specifying the table name twice. The ALTER TABLE part names the table. Try: Alter table TableName alter column [Date] default getutcdate()

提交回复
热议问题