当循环查找一张表的信息时,我们得写一张游标来对每条信息进行操作,具体格式如下

 

DECLARE @fitemid int

DECLARE #point_cursor CURSOR
FOR
SELECT fitemid
FROM ICStockBillEntry where finterid=1314     --每条信息从头到尾的写入
OPEN #point_cursor
FETCH NEXT FROM #point_cursor INTO @fitemid
while @@fetch_status = 0
BEGIN
select @fitemid= from table          --具体的逻辑
FETCH NEXT FROM #point_cursor INTO @fitemid
END
CLOSE #point_cursor
DEALLOCATE #point_cursor

相关文章:

  • 2022-01-19
  • 2021-05-24
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2021-06-22
  • 2022-02-14
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
相关资源
相似解决方案