Alter column, add default constraint

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 dbo.TableName.Date default getutcdate() 

but this gives me error:

Incorrect syntax near ‘.’

Does anyone see anything obviously wrong here, which I am missing (other than having a better name for the column)

7 Answers
7

Leave a Comment