You are right. Since version 20.2.242 the default date time data type on SQL Server is datetime2
.
Please refer to Use of datetime2 on SQL Server instead of datetime for more information.
According to the Microsoft documentation on that data type there are some advantages using datetime2
over datetime
:
Defines a date that is combined with a time of day that is based on 24-hour clock. datetime2 can be considered as an extension of the existing datetime type that has a larger date range, a larger default fractional precision, and optional user-specified precision.
This is exactly the reason this decision was made. If you want to force specific data type on your table columns, create the table by hand in SQL Server Management Studio, since there is currently no way to specify a deviating datatype mapping using Invantive SQL.