码迷,mamicode.com
首页 > 数据库 > 详细

sql 游标

时间:2015-04-21 12:50:13      阅读:123      评论:0      收藏:0      [点我收藏+]

标签:

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

sql 游标

标签:

原文地址:http://www.cnblogs.com/YyuTtian/p/4443920.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!