Home  >  Article  >  Database  >  sql 游标使用笔记

sql 游标使用笔记

WBOY
WBOYOriginal
2016-06-07 18:01:44841browse

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
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn