views:

1090

answers:

6

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.

A: 

Is the solution a database solution? Did you go New->Solution->Other->Database?

Once you create a database solution then setup your connection preferences you should be able to use the server explorer to edit and step-into the stored procedure. Please verify this still causes the issue?

Are you using an express edition?

Wayne
No, I use a 'normal' Solution that contains all kind of projects. Can I fix this without dropping my current solution?I use the professional version.
driAn
Ok, try adding a new solution File->Add->New Project and then select Other Project Types->Database. That should give you the DB project in your current solution. Hope this helps
Wayne
Tried this already, didn't help :(
driAn
A: 

I am having an identical situation. Did you figure this one out?

I have 2 versions of VS running on my machine and it is working on the 2005 version, but not in the 2008 version... don't know if this helps.
A: 

a link

YordanGeorgiev
A: 

I don't think ou can put breakpoints into it like you could in a normal VS application.

However you can create a temp table for logging, and on each line add a new entry into that temp table.

Bill Daugherty
you can debug just like you do VS application. Variables and (almost) everything else
Raj More
A: 

Can you see the code behind that stored procedure? If it is saved "WITH ENCRYPTION", you may not be able to see the code and then you will need the original source code for the proc to debug it.

Raj More
+1  A: 

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.

rwmnau
Yes you are right. It does not . I will log it as bug and pass on the URL
Ashwani Roy