According to MSDN:
SQL Server always treats ODBC data as being of the datetime data type.
*Conversion Notes*
1.ODBC string literals are mapped to the datetime data type. Any assignment
operation from ODBC DATETIME literals into date, time, datetime2, or datetimeoffset
types will cause an implicit conversion between datetime and these types as
defined by the conversion rules.
and Date range for Datetime
datatype is :
January 1, 1753, through December 31, 9999
so that's the reason why SQL server throws an error when ODBC string literal is used in last 3 statements, because there it does an implicit conversion to datatype Datetime
and not Datetime2
and values supplied are out of range values possible for Datetime datatype hence the error.
I hope this helps!!!