sql游标笔记

declare@pdtidnvarchar(50)
declare@ptypenvarchar(50)

declare my_cursor CURSORfor
select pdtid,ptype from dbo.Product
open my_cursor
fetchnextfrom my_cursor
into@pdtid,@ptype
while@@fetch_status=0
begin
fetchnextfrom my_cursor
end
close my_cursor
posted @ 2011-04-12 13:48  木由水  阅读(121)  评论(0编辑  收藏  举报