字符串或二进制数据将被截断。该语句已终止。 [英] String or binary data would be truncated. The statement has been terminated.

查看:213
本文介绍了字符串或二进制数据将被截断。该语句已终止。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取以下异常可能是什么原因



字符串或二进制数据将被截断。

该语句已被终止。

Getting following Exception what could be the reason

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

推荐答案

错误消息非常明确:字符串或二进制数据将被截断



我猜你是从应用程序插入(或更新)SQL中的一行。发生的事情是您尝试插入的数据不适合该字段:如果数据是文本,那么请查看列定义:您有一个定义的长度(例如)10或50个字符,但您的数据是尝试插入比这更长。

要么增加列的大小,要么减小要发送的数据的大小。
The error message is pretty explicit: "String or binary data would be truncated"

I'm guessing that you are inserting (or updating) a row in SQL from your application. What is happening is that the data you are trying to insert does not fit in the field: if the data is text, then look at the column definition: you have a defined length of (say) 10 or 50 characters but the data you are trying to insert is longer than that.
Either increase the size of the column, or reduce the size of the data you are sending.


检查数据库。 。

实际上这个问题可能发生在数据库中

例如



colum_name data_type

---------- ---------

id int

name varchar(8)

地址varchar(50)



你输入的值如1,anand rajan,chennai

id lenght 1

name lenght 10

地址长度6



这里名称长度超出因为名称数据类型长度为8



i希望它可以帮助你..



谢谢
check your database..
actually this problem may occurring from database
for example

colum_name data_type
---------- ---------
id int
name varchar(8)
address varchar(50)

you insert the value like 1,anand rajan,chennai
id lenght 1
name lenght 10
address length 6

here name length is exceeding because of name datatype length is 8

i hope its may be helps you..

thanks


您也可以从链接获得帮助: [ ^ ]
You can also get help from the link: [^]


这篇关于字符串或二进制数据将被截断。该语句已终止。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆