Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugging a stored procedure? 1

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,772
US
I would like to see what parameters are being passed to a stored procedure so I can attempt to figure out what is wrong with it.

I don't have the source code of the program that is calling the SP.... is there a way to stop a stored procedure when it is called, and then look at the parameters passed, and then perhaps even step through the procedure at that point?

TIA!



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
As far as I know you cannot breakpoint a sp. You can create a table to capture the values with an INSERT in the sp though.

Ni neart go cur le cheile.
 
Or run a trace with Profiler.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Genomon,
Actually, you can debug an sp with the most recent versions of visual studio. Technically you could call the sp from the VS IDE and debug it, if you've got the VS IDE...

How to debug stored procedures in Visual Studio .NET

Rhys

"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
Terry Pratchett
 
Rhys666 - a bookmark in my browser & a star for you. We're in the middle of "upgrading" SQL 2000 to 2005 and at work, only have SSMS. I have VS 2008 on my laptop though - this info was very helpful.
Thanks!

Ni neart go cur le cheile.
 
  • Thread starter
  • Moderator
  • #7
OK, markros.... I'll bite... how?

I'm running SQL Server 2008.



Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Actually, you can debug an sp with the most recent versions of visual studio. Technically you could call the sp from the VS IDE and debug it, if you've got the VS IDE..."

There is a way to do that via the code as mentioned when the program encounters the SP and also from the Server Explorer which is similar to stepping through the SP in SQL 2000 in debug mode.. I believe you need sys admin rights though.
 
Press the green button on the toolbar (close to execute).

However, in my SQL Server I'm currently getting an error about unable to activate Remote Debugging. I have R2 installed, so why do I get the error I don't know - it seems a new error after one of the Windows Updates.

PluralSight Learning Library
 
  • Thread starter
  • Moderator
  • #11
There is no debug "Play" button next to execute, unless I'm editing the SP... I need to debug it when it runs.... <Shrug>


Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top