SQL Server错误“字符串数据,右截断"是什么意思?是什么意思,我该如何解决? [英] What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it?
问题描述
我们正在网站上进行一些性能测试,并且经常遇到以下错误:
We are doing some performance tests on our website and we are getting the following error a lot:
*** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58
DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25.
第25行如下:
SELECT DISTINCT top 20 ZIP_CODE, CITY, STATE FROM Zipcodes WHERE (ZIP_CODE like ?) OR (CITY like ?) ORDER BY ZIP_CODE
最后,这是perl代码.
And lastly, this is perl code.
有什么想法吗?
编辑:这里的问题是我在zip文件中搜索字符串"74523%",该字符串过长.我最后只是不给%添加五个数字.
EDIT: the issue here was that I was searching in the zip file with the string "74523%" which is too long. I ended up just not adding the % if they give five digits.
推荐答案
为ZIP_CODE
提供的参数(长度)大于ZIP_CODE
的列宽,或者为CITY
提供的参数较大(在长度)小于CITY
的列宽.
Either the parameter supplied for ZIP_CODE
is larger (in length) than ZIP_CODE
s column width or the parameter supplied for CITY
is larger (in length) than CITY
s column width.
知道为两个?
占位符提供的值会很有趣.
It would be interesting to know the values supplied for the two ?
placeholders.
这篇关于SQL Server错误“字符串数据,右截断"是什么意思?是什么意思,我该如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!