字符串或二进制数据将在执行查询时被截断 [英] String or binary data would be truncated on executenonquery
本文介绍了字符串或二进制数据将在执行查询时被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
String or binary data would be truncated.
The statement has been terminated.
我的尝试:
What I have tried:
Line 38:
Line 39: conn.Open();
Line 40: cmd.ExecuteNonQuery();
Line 41: conn.Close();
Line 42:
推荐答案
如果你不理解错误信息,请谷歌吧!你会得到一个比问题更快的结果...
字符串或二进制数据将被截断。该语句已终止。 - Google搜索 [ ^ ] - 200,000次点击!
基本上,传递给SQL的数据不适合在你发送给它的列中:teh列可能是VARCHAR(50),或NVARCHAR(50),你传给它一个包含51个字符的字符串。
我们可以'为你解决这个问题:要么让你的列足够大以获取数据,要么检查数据,并且不要过多地传递给SQL。
If you don't understand an error message, google it! You will get a resutl a lot faster than asking a question...
String or binary data would be truncated. The statement has been terminated. - Google Search[^] - 200,000 hits!
Basically, the data you are passing to SQL does not fit in the column you are sending it to: teh column may be VARCHAR(50), or NVARCHAR(50) for example, and you are passing it a string with 51 characters in it.
We can't fix that for you: either make your columns big enough for the data, or check the data, and don't pass tso much to SQL.
根据这条解释,我们可以帮助......
如需一般解决方案,请参阅:
SQL SERVER - 使用存储过程|快速解决字符串或二进制数据将被截断 SQL Server门户 [ ^ ]
字符串或二进制数据将被截断:替换臭名昭着的错误8152 - MSSQL Tiger Team [ ^ ]
Based on this piece of explanation we can't help...
For general solution, please see:
SQL SERVER – A quick solution to ‘String or binary data would be truncated’ using Stored procedure | SQL Server Portal[^]
String or Binary data would be truncated: replacing the infamous error 8152 – MSSQL Tiger Team[^]
这篇关于字符串或二进制数据将在执行查询时被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文