Feature Only in Enterprise Edition SQL source code debugging is supported only in Visual C++ Enterprise Edition. For more information, see Visual C++ Editions.
Use the Watch window to specify local or global variables that you want to watch while debugging your program. You can also use this window to modify the values of local variables, but not global variables.
The Watch window contains four tabs: Watch1, Watch2, Watch3, and Watch4—Each tab displays a user-specified list of variables in a spreadsheet field. You can group variables that you want to watch together onto the same tab. For example, you could put variables related to a specific window on one tab and variables related to a dialog box on another tab. You could watch the first tab while debugging the window and the second tab while debugging the dialog box.
To add a variable to the Watch window
The Watch window appears.
The Watch window evaluates the variable immediately and displays the value or an error message. The Watch window displays values in their native SQL format.
Tip The Watch window does not display variable type information, but you can show variable type information by using the window’s property page.
To view type information for a variable
– or –
From the View menu, click Properties.
To remove a variable from the Watch window
When the program is paused at a breakpoint or between steps, you can change the value of any 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 certain logic errors.
To modify the value of a variable using the Watch window
– or –
Use the TAB key to move the insertion point to the value you want to modify.
Note You can’t modify image, text, or datetime data types. String variables (varchar) cannot be made longer.
Note Modified cached values 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 during the current debugging session. There is no way to force a refresh.