I'm trying to debug a T-SQL stored procedure, but when I start debugging, after getting the parameter dialog box from Query Analyzer, I get the following error message:
Server: Msg 504, Level 16, State 1, Procedure sp_sdidebug, Line 1 \[Microsoft\]\[ODBC SQL Server Driver\]\[SQL Server\]Unable to connect to
debugger on TAO (Error = 0x800706ba). Ensure that client-side components, such as SQLDBREG.EXE, are installed and registered on DMAHAPATRA1. Debugging
disabled for connection 72.
I have SQLDBREG.EXE installed on the client and registered on DMAHAPATRA1. Do you know what the problem might be?
Changes in SQL Server 2000 Service Pack 3 (SP3) are probably causing this problem. With SP3, the ability to debug stored procedures by using Microsoft Visual Studio 6.0 and older or by using pre-SP3 Query Analyzer is turned off by default. Application debugging (stopping at a T-SQL breakpoint while debugging a client application) is also turned off by default. To enable the debugging functionality, run sp_sdidebug, passing the parameter legacy_on. To disable debugging, pass legacy_off to this procedure. Note that Microsoft doesn't recommend running the sp_sdidebug stored procedure on production servers. You can find details about SP3's debugging changes in the sp3readme.htm file and in the Microsoft article "The T-SQL Debugger is turned off by default for earlier clients after you install SQL Server 2000 Service Pack 3," http://support.microsoft.com/default.aspx?scid=kb;en-us;328151. You can also find valuable troubleshooting information in the Microsoft articles "INF: Transact-SQL Debugger Limitations and Troubleshooting Tips for SQL Server 2000," http://support.microsoft.com/default.aspx?scid=kb;en-us;280101, and "INF: SQL Server 2000 SP3 Creates a SQLDebugger Windows User Account," http://support.microsoft.com/default.aspx?scid=kb;en-us;818374.
If running sp_sdidebug doesn't help and you've upgraded to Windows XP SP2, you might be hitting a different problem, documented in the Microsoft article "FIX: SQL debugging does not work in Visual Studio .NET after you install Windows XP Service Pack 2," http://support.microsoft.com/default.aspx?scid=kb;en-us;839280. According to this article, after you install XP SP2, the SQL debugging feature in Microsoft Visual Studio .NET 2003 might not work anymore. When you try to debug a SQL Server stored procedure by using the Step Into Stored Procedure option in the Server Explorer pane, you might receive the error message Cannot debug stored procedures because the SQL Server database is not setup correctly or user does not have permission to execute master.sp_sdidebug. Run SQL Server setup or contact database administrator. You can obtain a server-side fix for this problem by calling product support.