We are migrating from SQL Server 2005 to 2012. One of the functionality is failing with this error
com.microsoft.sqlserver.jdbc.SQLServerException: Implicit conversion from data type varbinary to datetime2 is not allowed. Use the CONVERT function to run this query.
We use SQLJDBC driver 3.0
to communicate with SQL Server 2012. I see this issue is happening when we try to insert NULL value into a DATETIME
column (nullable). Same however works in 2005. Any help with this issue is appreciated.
It's a simple INSERT
statement that fails from Java to SQL server 2012 using MyBatis ORM:
Insert into temp_test (date1, name, date2) values ('2010-10-10 00:00:00.0','test',null)
This insert fails when we try from our app (using SQL JDBC driver)... However same code base works without any issue in SQL 2005.