How to: Enable SQL Debugging on SQL 2000 Desktop Engines

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Standard

Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Pro and Team

Topic applies Topic applies Topic applies Topic applies

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

To enable the debugging of stored procedures on the SQL 2000 Desktop Engine, perform one of the two following procedures on the machine where the SQL 2000 Desktop Engine is installed, depending on whether Visual Studio is installed on the machine.

The first step in both procedures is to copy a file to the \Binn directory under the MSDE SQL Server installation directory, which by default is \Program Files\Microsoft SQL Server\MSSQL\Binn.However, the directory location may change between product releases, and SQL Server may have been installed in a customized location, so you may need to search for the directory. If so, search for the file sqlservr.exe, which resides in the \Binn directory.

To enable debugging with the SQL 2000 Desktop Engine on a machine with Visual Studio installed

  • Copy MSSDI98.DLL from the \sqlserver directory under the Visual Studio installation directory to the \Binn directory under the SQL Server installation directory.

    Visual Studio 2005 is installed by default at \Program Files\Microsoft Visual Studio 8. If it is not there, search for the file devenv.exe and the install directory will be the grandparent directory.

    An older version of MSSDI98.DLL may already exist in the SQL Server \Binn directory. If so, the older version must be replaced by the new version.

To enable debugging with the SQL 2000 Desktop Engine on a machine without Visual Studio

  1. Locate MSSDI98.DLL on the Visual Studio CD or DVD, and copy it to the \Binn directory under the SQL Server installation directory.

  2. Locate SQLDBG.DLL on the Visual Studio CD or DVD, and copy it to:

    program files\common files\microsoft shared\sql debugging

  3. Reregister SQLDBG.DLL by entering the following command at the Command Prompt:

    regsvr32 sqldbg.dll

  4. Grant execute permission on the stored procedure, sp_sdidebug, to the debugger user by executing the following command in Query Analyzer:

    USE master

    GRANT EXECUTE

    ON sp_sdidebug

    TO myUserName

See Also

Concepts

Debugging SQL

Other Resources

Setting Up SQL Debugging

Debug Settings and Preparation