Share via


Controlling the Call Stack Window

Feature Only in Enterprise Edition   SQL source code debugging is supported only in Visual C++ Enterprise Edition. For more information, see .

While using the SQL debugger, the Call Stack window displays the stack of currently active SQL code calls. Calling SQL source code pushes it onto the stack. When the SQL code returns, it is popped off the stack.

In the Call Stack window, the currently executing SQL code is at the top of the stack and older SQL calls are below it. By default, the window also displays parameter types and values for each function call. You can display or hide parameter types and values using the Debug tab of the Options dialog box or the right mouse button shortcut menu.

The Call Stack window acts much like the native Call Stack window. You can navigate to contexts in SQL source code. The Locals window also updates appropriately. From the Call Stack window, you can navigate to SQL statements and display the SQL statements in a source window.

To change the Call Stack display

  1. From the Tools menu, click Options.

  2. Choose the Debug tab.

  3. Under Call Stack window, click Parameter Values or Parameter Types, according to the information you want to display.

    – or –

  • In the Call Stack window, click the right mouse button, and from the shortcut menu, click Parameter Values or Parameter Types to toggle the display of that information.

To display the Call Stack window

  • From the View menu, click Debug Windows and Call Stack.

To view the Call Stack for SQL code

  1. Place the insertion point in the function.

  2. From the Debug menu, click Run To Cursor to execute your SQL code to the location of the insertion point.

    The Locals tab of the Variables window is updated automatically to display the local variables for the stored procedure.

  3. From the View menu, click Debug Windows and Call Stack.

    The stack lists calls in the calling order, with the current SQL code (the most deeply nested) at the top.

To navigate from the Call Stack window to a stored procedure’s statements

  • Double-click the stored procedure’s name in the Call Stack window.

    – or –

    Select the stored procedure name, and press ENTER.

This procedure changes only the view of the program shown in the Variables window and other debugger windows; it does not change the next line of execution or the value stored in the program counter.