Transact-SQL Debugger - Command Window
Applies to: SQL Server
Use the Command Window to run commands, such as debug and edit commands, against the code in the SQL Server Database Engine Query Editor window that is currently being debugged. You must be in debug mode to use the Command Window. The Transact-SQL debugger supports many of the commands that are also supported in the Microsoft Visual Studio Command window. For more information, see Visual Studio Command Window.
This feature works with SSMS version 17.9.1 and earlier.
Task List
To access the Command Window
- On the Debug menu, click Start Debugging.
To print the value of a variable
- In the CommandWindow, type Debug.Print <VariableName>, and then press ENTER.
To list information about the current thread
- In the CommandWindow, type Debug.ListThread, and then press ENTER.
To add a variable to the QuickWatch window
- In the CommandWindow, type Debug.QuickWatch <VariableName>, and then press ENTER.
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for