473,387 Members | 3,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

debugging stored procedures


Hello,

I am doing a lot of work with stored procedures at work now and am wondering
if there is a way that I can step through the code line by line and set
breakpoints on it like I do in VB/VBA to test variables/parameters.

Regards,

Jayne
Jul 23 '05 #1
4 1480
On Tue, 08 Mar 2005 21:38:46 +0000, Little PussyCat wrote:
I am doing a lot of work with stored procedures at work now and am wondering
if there is a way that I can step through the code line by line and set
breakpoints on it like I do in VB/VBA to test variables/parameters.


Hi Jayne,

In Query Analyzer, hit F8 to bring up the object browser. Find the
stored procedure, right-click it and select "Debug".

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #2
Hugo Kornelis (hugo@pe_NO_rFact.in_SPAM_fo) writes:
On Tue, 08 Mar 2005 21:38:46 +0000, Little PussyCat wrote:
I am doing a lot of work with stored procedures at work now and am
wondering if there is a way that I can step through the code line by
line and set breakpoints on it like I do in VB/VBA to test
variables/parameters.


In Query Analyzer, hit F8 to bring up the object browser. Find the
stored procedure, right-click it and select "Debug".


That's the theory.

In practice it appears that there is always something that prevents it
from working. To start with SQL Server must be running from a domain
account, and not local server. If you have Windows XP SP2 on the client,
you need at least 8.00.944 or the beta of SQL 2000 SP4, and you must
apply it on server and client. On top of that you must open port 135
in Windows firewall for the SQL box. (Do NOT open this port generally.)

And when all is done, you sysadm may get the idea that the Windows users
under which SQL Server runs is not permitted access to the workstations.
This how the last attempt ended in our shop.

I should add if you run SQL Server on your own machine, debugging
usually works.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3
You can also step into T-SQL stored procs from the VB or .NET development
environment. But personally, I have not found stepping into stored procs to
be all that useful since I could not see a way to examine the result sets of
queries. I have found using SQL profiler to be extremely useful for seeing
what parameters the calling app is passing in and which statements are
getting executed within the procedure. However, I think you need SA rights
to run profiler. To examine the result sets of queries, I usually just run
the guts of the procedure in Query Analyzer and use select statements to
dump the intermediate results. .
"Little PussyCat" <SP******@NOSPAM.com> wrote in message
news:cc************@tiger.sphynx...

Hello,

I am doing a lot of work with stored procedures at work now and am wondering if there is a way that I can step through the code line by line and set
breakpoints on it like I do in VB/VBA to test variables/parameters.

Regards,

Jayne

Jul 23 '05 #4
Miss Livvy (Xe*******************@yahoo.com) writes:
You can also step into T-SQL stored procs from the VB or .NET
development environment. But personally, I have not found stepping into
stored procs to be all that useful since I could not see a way to
examine the result sets of queries.


Yeah, I agree. Occassionally if a I have procedure with lot of procedural
logic, single-stepping through it can be helpful. The same is true if
want to look at the values of some variables.

But often I find too much hassle to start the debugger, so I rather
modify the procedure with some debug SELECT:s in strategic places.

Also, if your procedure raises an error and you want to debug that
happens after the error, the debugger does not appear to be very
co-operative.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Joe Sullivan | last post by:
I have noticed that Visual Studios .NET has a debug mode for SQL statements, but I can't seem to get it to work with MS SQL Server. I can't seem to pull up my stored procedures from the Server...
0
by: Ash | last post by:
Hi all, I have a C# web application which calls a number of stored procedures. I wish to step into the stored procedures while debugging i.e "Mix-mode debugging": I have completed the following...
3
by: srobinson | last post by:
I am trying to debug stored procedures via VS.NET. I've set up the debugging components and made the necessary configurations (security, DCOM, etc.). I was able to start successfully debugging stored...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
2
by: db2sysc | last post by:
All: I want to debug stored procedures in V8.2 and specifically see the values of my dynamic constructs. set v_sql ='SELECT COUNT(*) FROM DB2ADMIN. ' || v_table_name; How do I see value of...
3
by: Ash | last post by:
Hi all, I have a C# web application which calls a number of stored procedures. I wish to step into the stored procedures while debugging i.e "Mix-mode debugging": I have completed the following...
2
by: Ash | last post by:
Hi all, I have a C# web application which calls a number of stored procedures. I wish to step into the stored procedures while debugging i.e "Mix-mode debugging": I have completed the following...
2
by: Tina | last post by:
I have been through several examples of debugging stored procedures with VS.NET, the most recent being in Chap 12 of Mike Gunderloy's certification book. I have never found one that works. ...
2
by: rodchar | last post by:
hey all, is there possibly a way to step into a stored proc while debugging in asp.net? thanks, rodchar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.