Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug stored procedures in SQL server 2008 without CLR?

How can I debug stored procedures in SQL Server 2008 management studio?

I am trying to put a break point on SQL query and then press start debugging but I get an error that debugging cannot be started on my machine:

Debug cannot be started at <machine name>. 

I don't want to use CLR debugging. How can I debug stored procedures?

like image 924
AJ01 Avatar asked May 13 '11 14:05

AJ01


People also ask

How do I Debug a stored procedure in SQL Server 2008?

To debugging SP, go to database->Programmability->Stored Procedures-> right click the procedure you want to debug->select Debug Procedure.

Can we Debug stored procedure in SQL Server?

As with debugging in other programming languages, you can view and modify local variables and parameters, view global variables, as well as control and manage breakpoints while debugging your Transact-SQL script. This example shows how to create and debug a Transact-SQL stored procedure by stepping into it.

How do I enable debugging in SQL Server 2008 r2?

You can start the debugger by either clicking the Debug button on the Query toolbar or by clicking Start Debugging on the Debug menu or pressing ALT+F5.

Can we Debug stored procedure in SQL Developer?

SQL Developer's default “debug” action is to run until a breakpoint occurs. You can change this by going to Tools > Preferences, and clicking Debugger. Change the option that says “Start Debugging Option” to Step Into. This will allow you to click Debug and run to the first line of code.


1 Answers

Type exec YourStoredProcedure. Put break point next to it. Hit green (debug) arrow next to execute button. Debugger should start and hit your break point. Hit F11 to step into your stored procedure. See debug menu for more options.

Here is very detailed blog post: T-SQL Debugger for SQL Server 2008

like image 170
Ilya Berdichevsky Avatar answered Nov 15 '22 10:11

Ilya Berdichevsky