sql 游标

declare @id int

declare @name nvarchar(100)

declare cur cursor
for select id,name from JLCheckDocumentBill where id in (1,2,3)
open cur
fetch next from cur into @id ,@name
while @@fetch_status=0
BEGIN



fetch next from cur into @id,@name
END
close cur
deallocate cur

posted @ 2015-04-21 11:26  YyuTtian  阅读(104)  评论(0编辑  收藏  举报