Friday, March 9, 2012

Problem debugging SQL stored procedures

Hi
I am having a problem debugging SQL stored procedures from VS.net.
With some connections it works fine but when I try to debug a stored
procedure in a database on my local machine it fails. When I right
click and select ?Step into stored procedure' VS.NET goes into run
mode but I don't get the yellow arrow and I am unable to step through
the code.
I'm new to SQL and I'm not sure what other information I can supply
that will help. The connections themselves are the same except with
one the server is on my machine and with the other the server is on my
local network. If anyone has any suggestions as to what I can try to
get this to work, or even better, if someone has seen this problem
before, any help will be gratefully appreciated!
Many thanks
Julia.Julia
Do you mean by click on Server Explorer in .NET Project?
Are you getting aby error when you run the SP?
For me it works fine.
I'd write TRY CATCH error handler in .NET with SQLExceptions to see what is
an error trown by SQL Server?
or run this stored procedure in QA and debug it step by step
"Julia" <julia_beresford@.hotmail.com> wrote in message
news:6c293529.0407260531.28ba29cf@.posting.google.com...
> Hi
> I am having a problem debugging SQL stored procedures from VS.net.
> With some connections it works fine but when I try to debug a stored
> procedure in a database on my local machine it fails. When I right
> click and select 'Step into stored procedure' VS.NET goes into run
> mode but I don't get the yellow arrow and I am unable to step through
> the code.
> I'm new to SQL and I'm not sure what other information I can supply
> that will help. The connections themselves are the same except with
> one the server is on my machine and with the other the server is on my
> local network. If anyone has any suggestions as to what I can try to
> get this to work, or even better, if someone has seen this problem
> before, any help will be gratefully appreciated!
> Many thanks
> Julia.|||Julia
Hi Uri, in answer to your questions...
Do you mean by click on Server Explorer in .NET Project?
>> YES
Are you getting aby error when you run the SP?
>> YES, either by executing it from VB code and running the VB code in
debug mode or when I right click on the stored procedure in Server
Explorer and select ?Step Into Stored Procedure'.
For me it works fine.
>> For me it works (worked! ? see below) fine on all SQL databases
EXCEPT those on localhost
I'd write TRY CATCH error handler in .NET with SQLExceptions to see
what is an error trown by SQL Server? or run this stored procedure in
QA and debug it step by step
>> This morning I came in to work with the intention of doing as you
suggested but now I get the errors...
"Unable to start SQL debug session. Ensure sqldbreg2.exe and
proxy/stub DLL sqldbg.dll are registered on this machine."
And
"Attaching the T-SQL debugger to process ?[2104] StoredProcedures.exe'
on machine ?BWJULIA' failed. Error code 0x80004004."
...when I try to run the stored procedure with a breakpoint on it.
This is different to yesterday and I haven't changed anything (that
I'm aware of). I have registered sqldbreg2.exe and sqldbg.dll. I
also have the correct permissions set on the required folders for user
SQLDebugger.
Has anyone got debugging stored procedures to work successfully? The
behavior on my machine seems temperamental and I'm not sure if I need
to reinstall VS.NET.
Many thanks again for any help anyone can offer.
Regards
Julia Beresford.
"Uri Dimant" <urid@.iscar.co.il> wrote in message news:<utL0eYxcEHA.3420@.TK2MSFTNGP12.phx.gbl>...
> Julia
> Do you mean by click on Server Explorer in .NET Project?
> Are you getting aby error when you run the SP?
> For me it works fine.
> I'd write TRY CATCH error handler in .NET with SQLExceptions to see what is
> an error trown by SQL Server?
> or run this stored procedure in QA and debug it step by step
>
> "Julia" <julia_beresford@.hotmail.com> wrote in message
> news:6c293529.0407260531.28ba29cf@.posting.google.com...
> > Hi
> >
> > I am having a problem debugging SQL stored procedures from VS.net.
> > With some connections it works fine but when I try to debug a stored
> > procedure in a database on my local machine it fails. When I right
> > click and select 'Step into stored procedure' VS.NET goes into run
> > mode but I don't get the yellow arrow and I am unable to step through
> > the code.
> >
> > I'm new to SQL and I'm not sure what other information I can supply
> > that will help. The connections themselves are the same except with
> > one the server is on my machine and with the other the server is on my
> > local network. If anyone has any suggestions as to what I can try to
> > get this to work, or even better, if someone has seen this problem
> > before, any help will be gratefully appreciated!
> >
> > Many thanks
> >
> > Julia.

No comments:

Post a Comment