将截断字符串或二进制数据。是什么意思?查不出错来
DECLARE caller_Cursor CURSOR FOR
SELECT hbid,caller FROM #haobai_all where owner=6 order by called,owner
OPEN caller_Cursor
declare @id int, @caller char(30)
FETCH NEXT FROM caller_Cursor INTO @id,@caller
WHILE @@FETCH_STATUS = 0
BEGIN
select @caller=ltrim(rtrim(@caller))
if(len(@caller)> 8)--------------------------就是这一行
select @caller=substring(@caller,3,8)
insert into #haobai_detail select o.fax, o.cname, t.called, t.owner, 0, t.cduration, t.cf from #haobai_all t INNER JOIN CONTAINNUM c ON CONVERT(int, @caller) > = c.BeginNo AND convert(int,@caller) <= c.EndNo INNER JOIN offi o ON c.offname = o.offinum where (t.hbid=@id)
FETCH NEXT FROM caller_Cursor INTO @id,@caller
END
CLOSE caller_Cursor
DEALLOCATE caller_Cursor
那句查询里的convert改成转化为bigint也不行,出同样的错。
[解决办法]
declare @id int, @caller char(30)
-->
declare @id int, @caller varchar(30)
[解决办法]
把@caller的长度设置大一点
[解决办法]
把@caller的长度设置大一点
tongyi
[解决办法]
有一个字段你设置的长度小于要插入数据的长度,检查一下,找出那个字段改大些。