Fanr

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

USE AdventureWorksDW2008R2

declare @P1 int  --游标号码

declare @P2 int

set @P2=8  --参数[传入参数](可能是游标类型)

declare @P3 int

set @P3=1  --参数[传入参数](可能是游标锁类型)

declare @P4 int  --返回行数

begin

exec sp_cursoropen @P1 output, 

 N'select * from DimCustomer', 

 @P2 output, 

 @P3 output, 

 @P4 output

exec sp_cursorfetch @P1, 16, 1, 100

--exec sp_cursorfetch @P1, 16, 第几条开始, 多少条数据

WAITFOR DELAY '00:00:05'

exec sp_cursorclose @P1

end

posted on 2011-10-23 19:41  Fanr_Zh  阅读(310)  评论(0编辑  收藏  举报