Feature Only in Enterprise Edition SQL source code debugging is supported only in Visual C++ Enterprise Edition. For more information, see Visual C++ Editions.
The Variables window provides quick access to variables that are important in the program’s current context.
The window includes three tabs:
Each tab contains a spreadsheet with fields for the variable name and value. The debugger automatically fills in these fields.
In addition to the tabs, the Variables window has a Context box on the toolbar. This box displays a list of the current Call Stack in a drop-down list box. You can select a context from this list to specify the current scope of the variables displayed.
Tip The Context box is part of a toolbar that you can hide using the right mouse button.
You can expand or collapse the displayed variables using the tree controls, but you cannot add variables to the Variables window. You can add variables in the Watch window.
When the program pauses at a breakpoint or between steps, you can change the value of any non-const local variable in your program. This gives you the flexibility to try out changes and see their results in real time or to recover from some logic error and continue.
Note Changes to local variables may not take effect while you’re stepping through the SQL statement. Although you may have modified the value, it may never be checked again. There is no way to force a refresh.
Tip The Variables window does not display variable type information, but you can show variable type information by using the window’s property page. Move the insertion point to a variable name in the Variables window, click the right mouse button, and then click Properties. The type, expression (variable), and value are displayed in the Program Variable Properties window.
To display the Variables window
The Variables window appears.
To view type information for a variable
– or –
From the View menu, click Properties.
Although you cannot delete variables from the Variables window, you can edit the values of local variables.
To modify the value of a variable
Note You can modify only the following types of data: char, varchar, and integer data types. String variables (varchar) cannot be made longer.
Tip To change the value of strings, modify the individual characters.
You can navigate to SQL statements from the Context box in the Variables window. This box displays the SQL statements, if available, in a source window.
To navigate from the Variables window to SQL statements
This procedure changes only the view of the program displayed 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.