Hi @Johnathan Simpson ,
There are two main methods:
- By using
PRINT
statement in the strategic locations in a stored procedure. - By using inline T-SQL debugger (SSMS 17.9.1 and earlier, or Visual Studio)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What are some tips and tricks on how to troubleshoot a stored procedure?
Hi @Johnathan Simpson ,
There are two main methods:
PRINT
statement in the strategic locations in a stored procedure. I use a method in most of using PRINT statements around a variable @debug. Then you can turn it on and off when needed.
CREATE PROC ...
@debug int = 0
AS
IF @debug >0
PRINT 'stuff'
Hi,
The Transact-SQL debugger feature works with SSMS version 17.9.1 and earlier, it was removed from SSMS version 18.0. But you can install and use SSMS 17.x and SSMS 18.x side by side.
The demand for the debugger to be put back to SSMS 18 is very high on the SQL server use feedback, second only to the dark theme.
Also have a look on this similar case.
How to debug tsql code in Visual Studio since SSMS v18 does not have a debugger