当前位置:Gxlcms > mysql > sql游标使用笔记

sql游标使用笔记

时间:2021-07-01 10:21:17 帮助过:5人阅读

sql 游标使用笔记,需要的朋友可以参考下。

代码如下:

declare @pdtid nvarchar(50)
declare @ptype nvarchar(50)
declare my_cursor CURSOR for
select pdtid,ptype from dbo.Product
open my_cursor
fetch next from my_cursor
into @pdtid,@ptype
while @@fetch_status=0
begin
fetch next from my_cursor
end
close my_cursor

人气教程排行