调试存储过程错误,帮我看看 !!!

lingyunfeipu 2005-12-27 01:49:23
调试存储过程错误,帮我看看
我的机器是 200 pro ,sql-server 200 ,vs2003 都是e文的

当我用vs的debug 运行到 RETURN @iReturn,报错

An old version of SQL debugging components found on machine running SQL Server "xx1". Run remote debugging component install on the machine.
The thread 'Demo\xx1(58)' (0x800006ec) has exited with code 0 (0x0).
The program 'SQL Debugger: T-SQL' has exited with code 0 (0x0).

请问,怎么解决?


DECLARE @iReturn INT
SELECT @iReturn = @@Error

-- do your business transaction
IF 0 = @iReturn
BEGIN

BEGIN

select * from dbo.tTest
SELECT @iReturn = @@Error



END


END

RETURN @iReturn
...全文
218 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
LGame 2005-12-28
  • 打赏
  • 举报
回复
todouwang 2005-12-28
  • 打赏
  • 举报
回复
存储过程可以使用return来返回值或者数据集,
错误应该不在这个存储过程
ComponentOne 2005-12-28
  • 打赏
  • 举报
回复
权限问题。看 MSDN。 调试部分。
ComponentOne 2005-12-27
  • 打赏
  • 举报
回复
可能是:远程调试器 版本问题。好像”windows 服务“ 里面能看到这个服务。
-狙击手- 2005-12-27
  • 打赏
  • 举报
回复
本身过程没错
-狙击手- 2005-12-27
  • 打赏
  • 举报
回复
可以用return (N) 的
funsuzhou 2005-12-27
  • 打赏
  • 举报
回复
To libin_ftsafe(子陌红尘)
你怎么一下子变成5颗星了^_^
子陌红尘 2005-12-27
  • 打赏
  • 举报
回复
其中"返回代码"就是通过RETURN返回的。
子陌红尘 2005-12-27
  • 打赏
  • 举报
回复
在存储过程中不能使用带有返回值的 RETURN 语句
-----------------------------------------------------------------------------------------------------------------------------------------


SQL Server 2000 存储过程以下列 4 种形式返回数据:

1、输出参数,既可以返回数据(整型值或字符值等),也可以返回游标变量(游标是可以逐行检索的结果集)。

2、返回代码,始终是整型值。

3、SELECT 语句的结果集,这些语句包含在该存储过程内或该存储过程所调用的任何其它存储过程内。

4、可从存储过程外引用的全局游标。
lsqkeke 2005-12-27
  • 打赏
  • 举报
回复
存储过程要返回值,请指定 output参数
子陌红尘 2005-12-27
  • 打赏
  • 举报
回复
the problem you are facing is you fails to debug stored procedure in VS .NET 2003. I think more information is needed before moving forward:

1. Where is the SQL Server, on local host or on remote machine?

2. DCOM must be set up to allow remote users to debug on server. Also in some circumstances DCOM must be set up correctly to allow local SQL Debugging.

Configuring DCOM for SQL Debugging
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtskconfiguringdcomforsqldebugging.asp

3. Is remote procedure call (RPC) service started?

4. Please check Server Event Logs (server where SQL Server is running) - Application and System. This often gives us clues to what is causing the failure.

5. Make sure that you have correct versions of T-SQL Debugger component files.
Server components include Mssdi98.dll and Sqldbg.dll.
Client components include Sqldbreg.exe and Sqldbg.dll.

Please refer to the following KB article for troubleshooting:

INF: Transact-SQL Debugger Limitations and Troubleshooting Tips for SQL Server 2000
http://support.microsoft.com/?id=280101

INFO: Troubleshooting Tips for T-SQL Debugger in Visual Studio .NET
http://support.microsoft.com/?id=817178
lsqkeke 2005-12-27
  • 打赏
  • 举报
回复
在存储过程中不能使用带有返回值的 RETURN 语句
vivianfdlpw 2005-12-27
  • 打赏
  • 举报
回复
http://www.dotnet247.com/247reference/msgs/40/200769.aspx

1. Where is the SQL Server, on local host or on remote machine?

2. DCOM must be set up to allow remote users to debug on server. Also in
some circumstances DCOM must be set up correctly to allow local SQL
Debugging.

Configuring DCOM for SQL Debugging
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/htm
l/vxtskconfiguringdcomforsqldebugging.asp

3. Is remote procedure call (RPC) service started?

4. Please check Server Event Logs (server where SQL Server is running) -
Application and System. This often gives us clues to what is causing the
failure.

5. Make sure that you have correct versions of T-SQL Debugger component
files.
Server components include Mssdi98.dll and Sqldbg.dll.
Client components include Sqldbreg.exe and Sqldbg.dll.

Please refer to the following KB article for troubleshooting:

INF: Transact-SQL Debugger Limitations and Troubleshooting Tips for SQL
Server 2000
http://support.microsoft.com/?id=280101

INFO: Troubleshooting Tips for T-SQL Debugger in Visual Studio .NET
http://support.microsoft.com/?id=817178
lingyunfeipu 2005-12-27
  • 打赏
  • 举报
回复
赫赫,怎么不可以呢?
扑获系统错误号的,我用Query Analyzer 调试,一切正常
danisluo 2005-12-27
  • 打赏
  • 举报
回复
存储过程哪来的RETURN?只有在函数中才有RETURN

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧