SQL SERVER 游标循环读取表数据
SQL SERVER 游标循环读取表数据
declare @a varchar(50),@b int;
--定义游标
declare tempIndex cursor for (SELECT a, b from Bdc_Point)
--打开游标
open tempIndex
--抓取下一行数据给变量,一个或者多个
fetch next from tempIndex into @a, @b
--进行循环,0表示抓取成功,1表示抓取失败,2表示不存在抓取行
while @@fetch_status=0
转载
2021-03-16 18:38:36 ·
1975 阅读 ·
0 评论