You typically debug T-SQL logic in a local SQL Server database; which is the easiest way to debug. Running a saved proc locally allows you to easily execute your code and easily debug it.
If for some reason the problem appears only in SQL Azure, you may need to add some instructions that register what happens during the call to the stored procedure, and work on this problem.
source share