Call Stack Window
The Call Stack window displays the modules on the call stack, and the data types and values of any parameters that are passed to the modules. Transact-SQL modules include stored procedures, functions, and triggers. To display the call stack, you must be in debug mode.
To access the Call Stack window
On the Debug menu, click Windows, and then click Call Stack.
To change the current Call Stack frame
You can use either of the following procedures to make a stack frame the current frame:
Right-click the stack frame, and then click Switch To Frame.
Double-click the stack frame.
To view the source of a frame other than the current frame
Right-click the stack frame, and then click Go To Source Code.
Each row in the Call Stack window is called a stack frame and represents either a call from a Transact-SQL script file to a module or a call from one module to another. The bottom stack frame in the display indicates the line in the Database Engine Query Editor window that made the first call into the stack. The top row indicates the line on which the debugger paused execution, and is identified by a yellow arrow in the left margin of the window. Each intermediate row indicates the module and the line number of the source code that called the next higher stack frame.
All expressions in the Locals, Watch, and QuickWatch windows are evaluated based on the current stack frame. The Query Editor window displays the code for the current frame. By default, the current stack frame is the frame in which the Transact-SQL debugger paused execution. When you change the current stack frame to another frame, the expressions in the Locals, Watch, and QuickWatch windows are reevaluated in the context of the new frame, and the source code of the new frame is displayed in the Query Editor window.