Exception com. microsoft. sqlserver. jdbc. SQLServerException: The exception information for truncating string or binary data is as follows: Causedby: com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data. Atcom
An exception occurred while exchanging data from Oracle to the SQL Server intermediate database. microsoft. sqlserver. jdbc. SQLServerException: The exception information for truncating string or binary data is as follows: Caused by: com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data. At com
An exception occurred while exchanging data from Oracle to the SQL Server intermediate database.
Com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data.
The exception information is as follows:
Caused:
Com. microsoft. sqlserver. jdbc. SQLServerException: truncates string or binary data.
At com. microsoft. sqlserver. jdbc. SQLServerException. makeFromDatabaseError (SQLServerException. java: 216)
At com. microsoft. sqlserver. jdbc. SQLServerStatement. getNextResult (SQLServerStatement. java: 1515)
At com. microsoft. sqlserver. jdbc. SQLServerPreparedStatement. doExecutePreparedStatement (SQLServerPreparedStatement. java: 404)
At com. microsoft. sqlserver. jdbc. SQLServerPreparedStatement $ prep;texeccmd. doExecute (SQLServerPreparedStatement. java: 350)
At com.microsoft.sqlserver.jdbc.TDSCommand.exe cute (IOBuffer. java: 5696)
At com.microsoft.sqlserver.jdbc.SQLServerConnection.exe cuteCommand (SQLServerConnection. java: 1715)
At com.microsoft.sqlserver.jdbc.SQLServerStatement.exe cuteCommand (SQLServerStatement. java: 180)
At com.microsoft.sqlserver.jdbc.SQLServerStatement.exe cuteStatement (SQLServerStatement. java: 155)
At com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.exe cuteUpdate (SQLServerPreparedStatement. java: 314)
At com. ibm. ws. rsadapter. jdbc. WSJdbcPreparedStatement. pmiExecuteUpdate (WSJdbcPreparedStatement. java: 1104)
At com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.exe cuteUpdate (WSJdbcPreparedStatement. java: 771)
... 11 more
I searched for it on the internet for several reasons, which may cause this exception.
Http://www.cnblogs.com/lingy/archive/2012/09/14/2684491.html
Insufficient Field Length
Http://bbs.csdn.net/topics/330076495
Trigger processing business logic
This problem occurs when the field length is insufficient. The length defined in SQL Server is 24, and the length defined in Oracle is 50. Modify the field length. The problem is solved.
The SQL statement for determining the length is as follows:Meal certificate 20112101230000159"
SQL statements queried in SQL Server
Select len ('meal certificate 20112101230000159 '), datalength ('meal certificate 20112101230000159 ');
The length is 21 and 25 bytes are occupied.
SQL statements queried in Oracle
Select length ('meal certificate 20112101230000159 '), lengthb ('meal certificate 20112101230000159') from dual;
The length is 21 and 25 bytes are occupied.