这个存储过程怎么错了?

New919 New919 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
create procedure sp_getTables
@count int out
as
declare @id2 int , @id3 int
-- declare the cursor1
declare table2 cursor for select [tid] from table2
open table2
-- declare the cursor2
declare table3 cursor for select id from table3
open table3
fetch next from table2 into @id2
WHILE @@FETCH_STATUS = 0
begin
fetch next from table3 into @id3
while @@fetch_status = 0
begin
if @id2 = @id3
@count ++ // 这一行出错
fetch next from table3 into @id3
end
fetch next from table2 into @id2
end
close table2
deallocate table2
close table3
deallocate table3

我写的存储过程怎么错了阿?
...全文
评论 2
收藏 已收藏
分享
返回顶部
New919
.NET社区 62,272 成员 668,968 内容