您的位置:首页 > 博客中心 > 数据库 >

mssql游标demo

时间:2022-03-10 17:45

declare @billIds varchar(400)
declare @billId varchar(40)
DECLARE c1 CURSOR FOR
select top 5 SaleNo from Pos_Master where SaleDate>@dd -- 一次上传5笔
open c1
FETCH NEXT FROM c1 INTO @billId
WHILE @@FETCH_STATUS = 0
BEGIN
if @billIds is null begin
set @billIds=‘‘‘‘+@billId+‘‘‘‘
end else begin
set @billIds=@billIds+‘,‘+‘‘‘‘+@billId+‘‘‘‘
end
FETCH NEXT FROM c1 INTO @billId
end
close c1
deallocate c1

mssql游标demo,布布扣,bubuko.com

热门排行

今日推荐

热门手游