我的确是更改了 while @@fetch_status=0,上面的帖子写错了,但是还是多做了一条空记录
解决方案 »
- sql 2005 如何修改数据库引擎实例名称
- 联合模糊查询
- 还有谁对asp调用access熟悉点,帮帮忙啦...select...
- 一个查询条件的简单问题,谢谢
- SQL Server 2005 统计学生成绩
- 索引问题?
- 请教一个查询语句,谢谢
- 从微软网站下了更新SP3的联机帮助文件
- 我想要一个包含internet已注册域名的数据库,并请教您一个sql的语句!
- 安装好SQL Server 2000后,如果忘记了在安装过程中出现“身份验证模式”窗体中设置的sa登陆的密码,怎样在安装后获得呢?
- insert into select.... 中 AutoID 字段怎么办?
- 如何写出SQL语句求出正确的记录数?
fetch next from mfgmatreccursor
错了
改为
Fetch first from mfgmatreccursor into 订单号,采购单行号,库存项目,仓库,箱柜,数量,接收人,接收日期
出现了上述错误
while (@@fetch_status=0)
Begin
fetch next from mfgmatreccursor
End
(所影响的行数为 4 行)服务器: 消息 16911,级别 16,状态 1,行 3
fetch: 提取类型 absolute 不能用于只进游标。(所影响的行数为 1 行)
因为必须要FETCH一次才能判断游标的状态
如果你读入变量的则可以避免,比如declare mfgmatreccursor cursor
forward_only
for select 订单号 from mfgmatrectrans -- dk had modified at ...
for read only
go
open mfgmatreccursor
go
declare @_a
fetch next from mfgmatreccursor into @_a
while (@@fetch_status<>-1)
Begin
select @a
fetch next from mfgmatreccursor
End
go
close mfgmatreccursor
deallocate mfgmatreccursor