Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to debug stored procedures in SQL Azure?

I am working on SQL Azure and have written some stored procedures in it. Now while executing that stored procedure using EXEC query from the database i need to debug it to find the error if any. Is there any way to do so in SQL Azure?

Note:- I am using SQl Azure on SQL Server 2008 R2.

like image 475
Balraj Singh Avatar asked Jan 31 '12 15:01

Balraj Singh


People also ask

How do I debug a stored procedure in Azure SQL?

You can also export Azure SQL Databases to a local developer environment and do debugging locally. Finally, if you need to debug on Production use PRINT or SELECT statements of T-SQL to watch the values of variables or display intermediate result sets.

Is there a way to debug stored procedure?

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


1 Answers

Normally you debug T-SQL logic on a local SQL Server database; that's the easiest way to debug. Running the stored proc locally allows you to step through your code and debug it easily.

If for some reason the issue only shows up in SQL Azure, you may have to add some statements that log what's going on while the stored procedure is being called and work your way up to the issue.

like image 138
Herve Roggero Avatar answered Oct 10 '22 00:10

Herve Roggero