如何找出SQL Server中列的哪个值太大

时间:2016-12-01 13:30:48

标签: java sql-server database ibatis

我正在尝试将一组值插入SQL Server数据库中的表。该表包含600列。插入值时的异常如下。我们使用ibatis作为数据库事务的工具。

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1651)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:446)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:383)
 at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7465)
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2271)
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191)
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:365)
 at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:94)
 at sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:62)
 at com.sun.proxy.$Proxy197.execute(Unknown Source)
 at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:81)
 at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)
 at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)

在Oracle中,它会显示列的哪个值太大。在SQL Server中是否有任何方法可以找出导致此问题的值?提前谢谢!

0 个答案:

没有答案