Error: String or binary data would be truncated

Issue:

Exception as following snap. that is, your db column is no enough space. e.g. varchar(10) , you want to set length more than 10 char. 

"String or binary data would be truncated.nThe statement has been terminated."

Fix:

Make sure it has enough space.

### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated. ### The error may exist in file [D:\WorkSpace\CCC00910_NebulaService\target\classes\mapper\ArenaEventsDao.xml] ### The error may involve com.cmbchina.ccc.msp.nebulaservice.dao.ArenaEventsDao.saveArenaEvents-Inline ### The error occurred while setting parameters ### SQL: insert into arena_events ( topic, name, status, creator_id, channel, create_time, update_time ) values ( ?, ?, ?, ?, ?, GETDATE(), ? ) ### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated. ; String or binary data would be truncated.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104) ~[spring-jdbc-5.3.22.jar:5.3.22] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.22.jar:5.3.22] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.22.jar:5.3.22] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.22.jar:5.3.22] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91) ~[mybatis-spring-2.0.7.jar:2.0.7]什么问题
10-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值