Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging MS SQL Stored Procedure

I have a problem getting Stored Procedure debugging to work in Visual Studio 2008: When I start debugging, I get these success messages in the output window, however the actual stored procedure windows does not show up.

Auto-attach to process '[1640] [SQL] stagsql' on machine 'stagsql' succeeded.
The thread 'stagsql [67]' (0xf80) has exited with code 0 (0x0).
The thread 'stagsql [67]' (0xf80) has exited with code 0 (0x0).
The thread 'stagsql [69]' (0x908) has exited with code 0 (0x0).
The thread 'stagsql [69]' (0x908) has exited with code 0 (0x0).
The thread 'stagsql [69]' (0x908) has exited with code 0 (0x0).
The thread 'stagsql [69]' (0x908) has exited with code 0 (0x0).
Running [dbo].[uspCGetXYZ] ( @nLieferantId = 161616, @nStrukturId = -1, @nPageIndex = 1, @nPageSize = 16, @sSortColumn = arLangname, @nSortAscending = 1 ).

Visual Studio gets into 'debug mode' but the procedure does not show up at all.

The steps I did:

  • Enabled SQL debugging in the project settings
  • Opened the SQL Connection in Server Explorer
  • Enabled CLR/SQL debuggin on the connection
  • Right-click on the procedure and selected "step into stored procedure"

Alternatively I tried to open up the procedure and set a break-point there, it didn't help.

Any ideas? As said, the connection is there but Visual Studio is not capable of opening the procedure code.

like image 241
driAn Avatar asked Nov 26 '22 22:11

driAn


1 Answers

By any chance, do you have "Display Actual Execution Plan" selected? I've found that debugging won't run if you have that button clicked, though I can't for the life of me figure out why that would be the case.

I haven't submitted a bug on Connect, but would be happy to upvote one if somebody knows about it.

like image 82
SqlRyan Avatar answered Nov 29 '22 05:11

SqlRyan