Forum Discussion
T-SQL Debugger on Managed Instance for stored procedures
Good day all
I'm trying to work out how to set up the debugger for T-SQL in Managed Instance. There appears to be a dearth of information. Is that because it doesn't exist?
Could someone point to any info on setting up NSG rules and client rules(are they still the same?) to get the debugger working if they should exist?
1 Reply
- Alibaud69Copper Contributor
Unfortunately, at this time, T-SQL Debugger is not supported on Azure SQL Managed Instance for stored procedures. This is because the T-SQL Debugger requires extensive access to internal engine resources which are not exposed in Azure SQL Managed Instance.
If you need to debug a stored procedure in Azure SQL Managed Instance, you could try using print statements to output debug information to the messages tab. Additionally, you could consider using Extended Events or SQL Profiler to capture additional information about the execution of the stored procedure. [Link removed by admin]
Example: For example, if you want to output the value of a variable during the execution of a stored procedure, you could add a print statement like this:
DECLARE @myVariable INT = 42;
PRINT 'The value of @myVariable is ' + CAST(@myVariable AS VARCHAR);This will output the value of the variable to the Messages tab in SQL Server Management Studio or any other client tool you may be using to execute the stored procedure.