22,210
社区成员
发帖
与我相关
我的任务
分享
--执行1
DECLARE mytestcursor cursor LOCAL SCROLL FOR
SELECT TOP 2 name FROM sys.tables
--执行2
OPEN mytestcursor
/*
消息 16916,级别 16,状态 1,第 0 行
名为 'mytestcursor' 的游标不存在。
*/
create proc sp_showtable
as
begin
declare @name varchar(30)
declare mytestcursor cursor scroll for
select top 10 name from sysobjects
open mytestcursor
fetch next from mytestcursor into @name
while @@FETCH_STATUS = 0
begin
print @name
fetch next from mytestcursor into @name
end
close mytestcursor
deallocate mytestcursor
end
go
sp_showtable
go
drop proc sp_showtable
go
sysrscols
sysrowsets
sysallocunits
sysfiles1
syspriorities
sysfgfrag
sysphfg
sysprufiles
sysftinds
sysowners