SQL Server游标错误

编程入门 行业动态 更新时间:2024-10-10 12:23:46
本文介绍了SQL Server游标错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我编写了一个游标存储过程,以一张一张地获取打印的员工ID. 但是执行存储过程时出现错误 查询如下所示

I have written one cursor stored procedure for getting printing employee id one by one. but i am getting error while executing stored procedure The query is as folows

alter PROCEDURE SP_CURSOR as BEGIN DECLARE @empid INT DECLARE @GETEMPID CURSOR SET @GETEMPID = CURSOR FOR SELECT empid FROM testtable OPEN @GETEMPID FETCH NEXT FROM @GETEMPID INTO @empid WHILE @@FETCH_STATUS = 0 BEGIN PRINT @empid FETCH NEXT FROM @GETEMPID INTO @empid END CLOSE @GETEMPID DEALLOCATE @GETEMPID end

--EXEC SP_CURSOR 错误:消息16903,级别16,状态1,过程sp_cursor,第1行 使用错误数量的参数调用了"sp_cursor"过程 请帮我

--EXEC SP_CURSOR ERROR : Msg 16903, Level 16, State 1, Procedure sp_cursor, Line 1 The "sp_cursor" procedure was called with an incorrect number of parameters Please help me out

推荐答案

名称sp_cursor与内部存储过程名称冲突.更改过程的名称,它应该像超级按钮一样工作. The name sp_cursor conflicts with an internal stored procedure name. Change the name of the procedure and it should work like a charm.

更多推荐

SQL Server游标错误

本文发布于:2023-11-28 01:00:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640337.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:游标   错误   SQL   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!