Could you provide a code fragment that you are using where you construct the string and make the call
Thank you,
John (MSFT)
Hi,
Your guess that the problem lies with the second argument, java.sql.Types.NULL, is correct. When calling PreparedStatement.setNull, you need to specify the JDBC type corresponding to the SQL type of the parameter. In this case, you probably want to use java.sql.Types.TIMESTAMP.
Regards,
--David Olix [MSFT]
Hi,
According to https://java.sun.com/javase/6/docs/technotes/guides/jdbc/getstart/preparedstatement.html :
"The setNull method allows a programmer to send a JDBC NULL (a generic SQL NULL) value to the database as an IN parameter. Note, however, that one must still specify the JDBC type of the parameter."
SQL Server doesn't really support the SQL NULL type (corresponding to the JDBC NULLtype), just NULL values of other types. So this probably isn't something that we would support in the future. It would also present some difficulties with statement preparation and cause expensive repreparation if used with batch execution.
Regards,
--David Olix [MSFT]