In the BOL, all of the information pertaining to the debugger is under Transact-SQL Debugger. If you have both the client tools and the server running on the same machine, then there is no configuration needed to use the debugger. However, if you are using the client tools from one machine to connect to the database server on another machine, then you need to enable port and program exceptions by using the Windows Firewall Control Panel application on both the client and the server. We will look into those and other security related issues pertaining to the debugger in an upcoming post. In this post, we just want to go through an example of the debugger.
So, let’s prepare an execution script for executing a stored procedure in the Adventure Works database:
I am using a very simple example just to illustrate the feature:
declare @x datetime
select @x = GETDATE()
exec [uspGetBillOfMaterials] 799, @x
And now, press the debug button as shown in the image below – this will launch the debugger:
Once the debugger launches, you will see the different debug options at the top – Step Into, Step Over, Step Out, breakpoints etc. and at the bottom, you will see two windows – one for the local variables/Watch and the other one a call stack/Breakpoints/Command Window and the Output – these are tabbed interfaces. Here is the image that shows that:
And now, let’s step into the call to the procedure and you will see the local variable values and in the call stack, you will see the actual call.
This particular procedure only has a CTE which executes and returns back the records so it will exit out as we process through it and will return back the records. Using the debugger, troubleshooting issues becomes easier especially in the case of larger procedures and the nested procedures which call other procedures or views/functions.
What a information of un-ambiguity and preserveness of precious
ReplyDeleteknow-how on the topic of unexpected emotions.
My weblog: bmi chart women
This article will help the internet visitors for creating new website or even a blog from start to
ReplyDeleteend.
Here is my homepage ... more