Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Tuesday, March 20, 2012

Cannot Debug SQL 2005 Stored Procedures in VS 2005

I am having trouble in consistently debugging T-SQL stored procedures in SQL
2005 using VS 2005 Pro. I have enabled debugging on the connection in the
Server Explorer and enable CLR Integration in the Surface Area Configuration
tool. At one point I could step into the sproc but now I cannot. What has
gone wrong. How can I be able to consistently debug T-SQL sprocs?
Any input would be appreciated."=?Utf-8?B? RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==
?="
<EagleRedHighFlyingBirdscom@.discussions.microsoft.com> wrote in
news:2EC86A08-79A4-44CC-ABDF-72DAE46D1BF0@.microsoft.com:

> I am having trouble in consistently debugging T-SQL stored procedures
> in SQL 2005 using VS 2005 Pro. I have enabled debugging on the
> connection in the Server Explorer and enable CLR Integration in the
> Surface Area Configuration tool. At one point I could step into the
> sproc but now I cannot. What has gone wrong. How can I be able to
> consistently debug T-SQL sprocs?
>
Hmm, in order to debug T-SQL proc's you should not have to do any
enabling at all.
1. Open VS 2005
2. Open Server Explorer
3. Create a connection to the database the proc is in
4. Expand the database and drill down to Stored Procedures, expand.
5. Right click on the proc and choose "Step Into Stored Procedure".
6. Debug
What happens for you when you try the above?
Niels
****************************************
**********
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb@.no-spam.develop.com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
****************************************
**********|||The debugger starts but when I either step into or step to the next statemen
t
in the proc the proc runs to completion. I have set a breakpoint in the pro
c
only to have it disabled when debugging starts.
"EagleRed@.HighFlyingBirds.com" wrote:

> I am having trouble in consistently debugging T-SQL stored procedures in S
QL
> 2005 using VS 2005 Pro. I have enabled debugging on the connection in the
> Server Explorer and enable CLR Integration in the Surface Area Configurati
on
> tool. At one point I could step into the sproc but now I cannot. What ha
s
> gone wrong. How can I be able to consistently debug T-SQL sprocs?
> Any input would be appreciated.|||Here's some additional information. The disabled breakpoint displays a
tooltip that says the breakpoint will not be hit because the object
containing the breakpoint has not been loaded. What's going on? I have bee
n
able to debug and hit breakpoints, but I cannot do it consistently and right
now it simply isn't working.
"Niels Berglund" wrote:

> "=?Utf-8?B? RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==
?="
> <EagleRedHighFlyingBirdscom@.discussions.microsoft.com> wrote in
> news:2EC86A08-79A4-44CC-ABDF-72DAE46D1BF0@.microsoft.com:
>
> Hmm, in order to debug T-SQL proc's you should not have to do any
> enabling at all.
> 1. Open VS 2005
> 2. Open Server Explorer
> 3. Create a connection to the database the proc is in
> 4. Expand the database and drill down to Stored Procedures, expand.
> 5. Right click on the proc and choose "Step Into Stored Procedure".
> 6. Debug
> What happens for you when you try the above?
> Niels
> --
> ****************************************
**********
> * Niels Berglund
> * http://staff.develop.com/nielsb
> * nielsb@.no-spam.develop.com
> * "A First Look at SQL Server 2005 for Developers"
> * http://www.awprofessional.com/title/0321180593
> ****************************************
**********
>

Cannot Debug SP.

Hi, everybody?!
I cannot use debugging function on some clients. For example, on my PC I
cannot use debugging facility.
Whenever I try to use debugging facility, it just returns results and ends.
I cannot use step-by-step function.
But on my laptop, I can use the function very well.
I wonder why I can't use the function on some clients, and can on other
ones.
Thanks.This is usually fixed by stepping through the section in BooksOnLine under
"troubleshooting SQL Server, Transact-SQL debugger" and ensuring you have
all the steps done correctly.
--
Andrew J. Kelly
SQL Server MVP
"Kim, KeukTae" <zyuuzika@.korea.com> wrote in message
news:OweEoodSDHA.3700@.tk2msftngp13.phx.gbl...
> Hi, everybody?!
> I cannot use debugging function on some clients. For example, on my PC I
> cannot use debugging facility.
> Whenever I try to use debugging facility, it just returns results and
ends.
> I cannot use step-by-step function.
> But on my laptop, I can use the function very well.
> I wonder why I can't use the function on some clients, and can on other
> ones.
> Thanks.
>
>

cannot debug class liberary sproc

im trying to debug a sproc that was written as a class liberary, in c#. i go to the debug menu in visual studio, and click "attach to process". i attach to the sqlsevr process. but now, any breakpoints i create give the message :

"he breakpoint will not currently be hit. no symbols have been loaded for this document"

and no matter how i execute the sproc in sql server, my breakpoints are never hit. what is wrong here?

Have you uploaded the debug symbols file to SQL Server?

ALTER ASSEMBLY your_asm_name
add file from 'some location'

You better check the syntax for ALTER ASSEMBLY as I wrote it from memory and I don't have BOL handy at the moment.

Niels|||Hmm, I was almost certain I had replied to this a couple of minutes ago (I apologize if this post appears twice).

Have you uploaded the debug symbols file from your assembly to the database?

The syntax is as follows:

ALTER ASSEMBLY your_asm_name
ADD FILE FROM 'path_to_debug_symbols'

You better check the syntax above, as I wrote it from memory and I don't have BOL handy.

Nielssql

Cannot debug activated CLR Stored Procedure

Hi

I'm having a problem debugging (with VS2005,) a CLR Stored Procedure which is activated on a queue. I know it is working because it is consuming and processing messages when one appears in the queue.

I can debug it 'manually' by either right-clicking on the SP within VS2005 and selecting 'Step into Stored Procedure' or by attaching to the SQL Server Management Studio process, setting a breakpoint and executing the stored procedure from a Management Studio query window.

However, if I send a message to my queue within Management Studio, my breakpoints are NOT being hit within VS2005, but the message IS reaching my queue and it IS being processed by the SP.

Can anyone help?

Thanks

The only way to debug this is by attaching VS debugger directly to sqlservr.exe (i.e. the database engine) for managed debugging. You will need to install the Visual Studio Remote Debugger on the machine running the engine and you will need to add symbols to your assembly.

Hope that helps,

Rushi

Cannot debug activated CLR Stored Procedure

Hi

I'm having a problem debugging (with VS2005,) a CLR Stored Procedure which is activated on a queue. I know it is working because it is consuming and processing messages when one appears in the queue.

I can debug it 'manually' by either right-clicking on the SP within VS2005 and selecting 'Step into Stored Procedure' or by attaching to the SQL Server Management Studio process, setting a breakpoint and executing the stored procedure from a Management Studio query window.

However, if I send a message to my queue within Management Studio, my breakpoints are NOT being hit within VS2005, but the message IS reaching my queue and it IS being processed by the SP.

Can anyone help?

Thanks

The only way to debug this is by attaching VS debugger directly to sqlservr.exe (i.e. the database engine) for managed debugging. You will need to install the Visual Studio Remote Debugger on the machine running the engine and you will need to add symbols to your assembly.

Hope that helps,

Rushi