问题描述:KIS商贸版1.2,原谅我的客户还在用这个老版本,结账失败,提示:将截断字符串或二进制数据。
问题分析:跟踪了一下出错的地方,发现如下问题:
Set NoCount On
If Object_ID('tempdb..#TempCalBills') Is Not Null Drop Table #TempCalBills
Create Table #TempCalBills(
FInterID int IDENTITY(1,1),
FClassTypeID int,
FBillTypeID int,
FID int,
FEntryID int,
FBillNo varchar(80),
FDate datetime,
FCalDate datetime,
FStatus int,
FVoucherID int,
FCostVchID int,
FSupplyID int,
FCustID int,
FDCStockID int,
FDCTypeID int,
FSCStockID int,
FSCTypeID int,
FItemID int,
FNumber varchar(80),
FTrack int,
FBatchNo varchar(80),
FQty Decimal(28,10),
FProFitLossQty Decimal(28,10),
FPrice Decimal(28,10),
FCostPrice Decimal(28,10),
FAmount Decimal(28,10),
FCostAmount Decimal(28,10),
FRefAmount Decimal(28,10),
FClassID_SRC int,
FID_SRC int,
FEntryID_SRC int,
FDate_SRC datetime,
FTableName varchar(20) )
Insert Into #TempCalBills select * from vw_cc_StockBillEntry where fdate>='2011-7-1'
Select Distinct t.*,(c.FName_CHS+case when t.FBillTypeID<=1 then '' else '-'+b.FName end) as FClassTypeName,'' as FBillTypeName
From #TempCalBills t Inner Join ICClassType c On t.FClassTypeID=c.FID
Left Join t_BaseBillTypeData b On t.FBillTypeID=b.FID
Where 1=1 And (t.FDCStockID=349 Or t.FSCStockID=349)
and t.FDate<'2011-8-1'Order By t.FDate,t.FID,t.FInterID
Drop Table #TempCalBills
Set NoCount off
在执行到红色部分时就出来提示:将截断字符串或二进制数据
通过报错信息查看,可能是由于字符型的字段超出#TempCalBills表中的字段长度。
解决方法:经过测试把t_stockbill里的FBILLNO里的字符改一下就OK了
champix pfizer
champix champix debat
bimatoprost
open bimatoprost hair