Click here to Skip to main content
11,411,840 members (48,393 online)
Click here to Skip to main content
Technical Blog

Tagged as

Store Procedure Debugging in VS2008

, 18 Jan 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Debugging is cool. I mean what would have been happened to developers if they couldn’t debug their code!! Speaking of myself at some point I probably would’ve got pissed off and started to seek some other job. One reason I never was comfortable with database programming was unable to debug the code.

Debugging is cool. I mean what would have been happened to developers if they couldn’t debug their code!! Speaking of myself at some point I probably would’ve got pissed off and started to seek some other job. One reason I never was comfortable with database programming was unable to debug the code. But since last year I started to be cool about it while I found out this “Store Procedure Debugging” thing. I know many developers still like SQL profiler but I always wanted to see the code line by line what happens. Beside profiler has actually different features.

You’ll need Visual Studio 2008 Professional/Team System for enabling this feature. Express or Standard Editions aren’t gonna work. And of course you’ll need control over your Sql Server.

At first establish a connection with the database to the project. You do that by choosing View->Server Explorer->Add Connection.

2009-09-26_170543

After you establish the connection its kinda look like this:

2009-09-26_171856

Right click on a procedure and Open it. For this example I’m gonna debug ‘spGetAcademicQualification’.

2009-09-26_172432

Now if you want to debug this proc right click on the proc and click “Step Into Stored Procedure”.

runputvalue

A window will pop up and show you the parameters and let you put values on them. Then click the OK button to step into the procedure. The debugger will automatically stop execution on the first line of code in the stored procedure. When the debugger has stopped execution you’ll see a yellow arrow to the left of the line of code just like VS debugger.

If you wonder what else works.. I should tell you it seems to me its attitude is actually more likely the VS debugger. You can use break points. Things like Immediate Window, Quick Watch, Add Watch works in here. More importantly you can view the parameters values. You can also edit them in their scope. There is several methods to do that. You can simple hover the mouse on them and change the values or do it in Watch window as you wish. Wanna step into next line try F10/F11 (C#).

Scroll bellow to see some images.

break-point1-1024x401

mouse-hovering-1024x431

immediet

quick-watch1

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Md Nazmoon Noor
Software Developer (Senior)
Bangladesh Bangladesh
No Biography provided

Comments and Discussions

 
GeneralMy vote of 5 Pinmembermagicpapacy21-Jan-13 17:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.5 | Last Updated 18 Jan 2013
Article Copyright 2013 by Md Nazmoon Noor
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid