Search
Home
Articles
Backup
Books
Certification
FAQ
Products
Replication
Scripts
Seminars
Training
TSQL

MSDN Fourms
Fort Worth SSUG
Oklahoma City SSDG

Resume

Champion Valley Pens

SQL-Programmer IX SP2 with TSQL Debugger 1 2 3 4 5 6 7 8 9 10 11 12

The remainder of this review focuses on the most important feature that is now available to developers and DBAs, the TSQL debugger.  My systems are running SQL Server 7.0 SP1 with all of the bells and whistles on Windows 2000 RC2 at this point.   That means for me, there was no additional setup involved.  In order to debug, you have to have the debugging files installed for SQL Server.  These can be added through setup by running a custom setup and selecting debugging from the development tools.  You then need to have DCOM configured on your system.  The help files walk you through that process for Win 9x and NT.  If you are running Windows 2000, DCOM is already configured correctly and enabled.  The TSQL debugger can also run against version 6.5, but there is some prep work that needs to be done to enable this functionality. You can download the script to create the stored procedures that I used in this example here.  The 3 procs in this example simply have a loop that calls the next stored procedure.  This gives you a very simple feel for the capabilities of the debugger.

sql-programmerix-23.gif (21179 bytes)

The second toolbar has all of the debugging features.  The watch window and call stack can be opened from the 2 buttons that you see depressed.  These will float over the development surface and give you access to the current state of execution.  The watch window will display the values for any parameters that were passed in and the current value of any local variables.  The global variables tab displays the values for all of the global variables.  For some reason, the global variables never populated and simply displayed null for each one.  The call stack gives you a list of the stored procedures in the current calling chain.  I've created 3 stored procedures that get called from each other.  The figure below is currently in the 3rd procedure and shows that the currently executing procedure is the 3rd one which was called from debugproc2 which was called from debugproc1.  Once debugging is enabled on your system, to begin debugging, simply click the Step Into button (7th from left on second toolbar).  There will be a short pause as debugging is loaded and you will see a little yellow arrow pointing at the next line to be executed.  You can step one line at a time, set breakpoints, step over lines, and run to a cursor position.

SQL-Programmer IX SP2 with TSQL Debugger 1 2 3 4 5 6 7 8 9 10 11 12

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.