Click here to Skip to main content
12,998,423 members (71,886 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 18 Jan 2013

Stored Procedure Debugging in VS2008

, 18 Jan 2013
Rate this:
Please Sign up or sign in to vote.
How to debug Stored Procedure in VS2008

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 that I was unable to debug the code. But since last year, I started to be cool about it while I found out this “Stored Procedure Debugging” thing. I know many developers still like SQL profiler but I always wanted to see what happens to the code line by line. Besides, the profiler actually has different features.

You’ll need Visual Studio 2008 Professional/Team System for enabling this feature. Express or Standard Editions aren’t going to 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.


After you establish the connection, it's kinda look like this:


Right click on a procedure and open it. For this example I’m going to debug ‘spGetAcademicQualification’.


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


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 are several methods to do that. You can simply hover the mouse on them and change the values or do it in Watch window as you wish. Want to step into next line, try F10/F11 (C#).

Scroll below to see some images:






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


About the Author

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

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
magicpapacy21-Jan-13 16:07
membermagicpapacy21-Jan-13 16:07 

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

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

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