I am getting an exception when doing a batch insert operation using a prepared statement from Java.
java.sql.BatchUpdateException: The prepared statement handle 5 is not valid in this context. Please verify that current database, user default schema, and ANSI_NULLS and QUOTED_IDENTIFIER set options are not changed since the handle is prepared.
While analyzing this error message all I could find out was its error message id : 586. I could not gather any more information about this issue.
Can anyone help me with the reason for this exception, what it means and how to resolve it ?
Machine Details :
SQL Server Version - SQL Server 2014
jTDS JAR Version - 1.2.4
PS : This exception only occurs on a particular remote machine. We cant reproduce this issue locally. Any tips on how to reproduce this issue would also be helpful.