Why does SQL Server force me to table the table so that I can edit a DateTime field to DateTime2 (3)?

advertisements

I am trying to alter a table field - with some rows in it - from DateTime to DateTime2(3).

But the SQL Server Management Studio complains that I have drop and re-create the table.

But why?

Isn't DateTime2(3) has more precision than DateTime type? It should be fine, should not it be?


There is a setting in SSMS that will allow you to do what you want.. Menu-Tools-Options-Designers-Prevent saving changes that require table re-creaction.

SSMS has a habit of recreating almost any changes you do. It should be just fine to only alter the column data type with something like this.

alter table TableName alter column ColName datetime2(3)