Welcome to dbForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Debugging Stored Procs

 
   Database Forums (Home) -> General Discussions RSS
Next:  I want to extract values in an array depending of..  
Author Message
Cralis

External


Since: Jun 17, 2008
Posts: 20



(Msg. 1) Posted: Sun Nov 23, 2008 3:22 pm
Post subject: Debugging Stored Procs
Archived from groups: comp>databases>ms-sqlserver (more info?)

Hi Guys,

Just a quick question on the availability of debugging stored procs.
At the moment, if I have an issue, what I do is firstly work out what
the SP is doing. Then I look over it, looking for an abvious error
(We're assuming wrong data is being returned). If I can't spy the
issue, I then create PRINT statements in the SP and run it, checking
values as it goes through - and after a lot of crying, head banging
and writing on these helpful groups - the issue gets spotted and
resolved.

I'd like to know if there is a better way to debug SPs. I assume there
is no way to 'step through' the code. I'm not sure why that's not
possible. It would indeed be pretty funky to 'F9' your way through the
SP, and hoving over variables to check their values.

I'd like to know what your ways of debugging are, and if mine is the
most efficient use of time.

Thanks guys,
Craig

 >> Stay informed about: Debugging Stored Procs 
Back to top
Login to vote
Tom van Stiphout

External


Since: Sep 29, 2008
Posts: 54



(Msg. 2) Posted: Sun Nov 23, 2008 10:02 pm
Post subject: Re: Debugging Stored Procs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 23 Nov 2008 15:22:24 -0800 (PST), Cralis <info.RemoveThis@listerhome.com>
wrote:

Actually there *is* as way to step through a sproc's code. If you have
Visual Studio. Not sure if the free Visual Studio Express Edition
offers the same benefits.

-Tom.
Microsoft Access MVP


>Hi Guys,
>
>Just a quick question on the availability of debugging stored procs.
>At the moment, if I have an issue, what I do is firstly work out what
>the SP is doing. Then I look over it, looking for an abvious error
>(We're assuming wrong data is being returned). If I can't spy the
>issue, I then create PRINT statements in the SP and run it, checking
>values as it goes through - and after a lot of crying, head banging
>and writing on these helpful groups - the issue gets spotted and
>resolved.
>
>I'd like to know if there is a better way to debug SPs. I assume there
>is no way to 'step through' the code. I'm not sure why that's not
>possible. It would indeed be pretty funky to 'F9' your way through the
>SP, and hoving over variables to check their values.
>
>I'd like to know what your ways of debugging are, and if mine is the
>most efficient use of time.
>
>Thanks guys,
>Craig

 >> Stay informed about: Debugging Stored Procs 
Back to top
Login to vote
Plamen Ratchev

External


Since: Aug 20, 2008
Posts: 182



(Msg. 3) Posted: Sun Nov 23, 2008 11:29 pm
Post subject: Re: Debugging Stored Procs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In versions prior to SQL Server 2008 I primarily used SELECT/PRINT
statements to debug. But SQL Server 2008 added back the T-SQL debugger
(which was available in SQL Server 2000) and it is improved a lot.
Recently had to debug a client SP that was 3000+ lines of code, and the
SQL Server 2008 debugger was great.

Also, Visual Studio 2005 has debugging functions for SQL Server 2005.
Here is one article on the topic:
http://aspnet.4guysfromrolla.com/articles/051607-1.aspx

--
Plamen Ratchev
http://www.SQLStudio.com
 >> Stay informed about: Debugging Stored Procs 
Back to top
Login to vote
Cralis

External


Since: Jun 17, 2008
Posts: 20



(Msg. 4) Posted: Mon Nov 24, 2008 3:21 pm
Post subject: Re: Debugging Stored Procs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks kindly, Tom and Plamen.

I'll check the VS and SQL2008 debugging. Thanks for pointing that out.
 >> Stay informed about: Debugging Stored Procs 
Back to top
Login to vote
Display posts from previous:   
   Database Forums (Home) -> General Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]