views:

343

answers:

1

Is there any possibility to directly dive into SQL Server stored procedures from .net code? So when debugging step by step in .net, I'd like to step into a called stored procedure.

I know how to debug them individually, but I'd like to join these debug sessions in order to gain some time.

+4  A: 

I've always found this a little tricky, but it is possible.

First you have to enable T-SQL debugging in the IDE for the project/solution, then you have to set up the database connection as part of the project/solution.

Actually stepping into a stored procedure appears to be troublesome, but if you open the stored procedure code and explicitly set a breakpoint in there, it will hit the breakpoint.

Andrew Rollings
Does this only work if you are using a Database project?
sestocker
I'm not sure. It's been a while since I've done it. I know that you have to have the connection set up as part of the solution.
Andrew Rollings
how do you set up the connection to be part of the solution? when I put a breakpoint on the stored procedure, it says No symbols were loaded.
sthay
There are some detailed instructions here:http://www.sqlteam.com/article/debugging-stored-procedures-in-visual-studio-2005
Andrew Rollings
This is also helpful (for an outdated version of VS, but still accurate): http://support.microsoft.com/kb/316549
Andrew Rollings