Groups | Blog | Home
all groups > visual studio .net debugging > july 2004 >

visual studio .net debugging : Cannot break at stored procedures from VC.NET 2003


Juan Dent
7/30/2004 1:57:02 PM
I cannot debug a SQL Stored Procedure from within a C# program, even though I have SQL Debugging enabled for that project and everything else has been checked with the instructions in MSDN DVD.

The funny and confusing thing is thay I can debug a stored procedure in Query Analyzer with no problems at all. I can also Step Into Procedure from within VS.NET 2003. It is only when I execute an OleDbCommand whose type is StoredProcedure that my breakpoints in the Stored procedure are missed. I tried ExecuteNonQuery and ExecuteReader to no avail.

Also, I used to be able to do this, prior to my current installation - I had to reinstall my laptop.

When I point my cursor at the breakpoint, a yellow message saying "The breakpoint will not currently be hit. Unable to bind SQL breakpoint at this time. Object containing the breakpoint not loaded."

Any ideas?

--
Thanks in advance,

v-garych NO[at]SPAM online.microsoft.com (
8/2/2004 7:41:23 AM
Hi Juan,

How do you debug the stored procedures in Visual Studio .NET? Do you have
followed the approach in the following KB:
HOW TO: Debug Stored Procedures in Visual Studio .NET
http://support.microsoft.com/?id=316549

And which database do you work on, is it SQL Server 2000 SP3?
if so , please check the Knowledge Base Article - 32815:
INF: T-SQL Debugger Is Turned Off By Default for Earlier Clients After You
Install SQL Server 2000 Service Pack 3
http://support.microsoft.com/?kbid=328151

By the way, how about use the SqlCommand?


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Juan Dent
8/3/2004 1:17:01 PM
Nope, I can't make it work. And the article 32815 is for older clients (pre SP3 Query Analizer and Visual Studios previous to Visual Studio .NET.

So my problem is reopened. I cann't break into stored procedures. I get the following tip when I move the mouse to the text of the stored procedure in VS.NET 2003:

"The breakpoint will not currently be hit. Unable to bind SQL breakpoint at this time. Object containing the breakpoint not loaded."

Any more ideas?


--
Thanks in advance,

Juan Dent, M.Sc.


[quoted text, click to view]
v-garych NO[at]SPAM online.microsoft.com (
8/4/2004 7:29:46 AM
Hi Juan,

Thanks for your response!


[quoted text, click to view]

That Knowledge Base Article(328151) also appies to the "Visual Studio .NET
Application Debugging", I suggest you test the following methods:

1. Enabled SQL Debugging within the project settings: Project's
properties/Configuration Properties/Debugging, make sure that Enable SQL
Debugging is set to True. This should load required symbols that would be
needed to step into stored procedures in any given debugging session.

2. Run the following SQL code: exec sp_sdidebug 'legacy_on' on the
Master database(this is due to the extra level of security that was added
in SQL SP3).


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Juan Dent
8/4/2004 3:29:01 PM
Thanks again Gary. I don't what I did different before, maybe I executed
exec sp_sdidebug 'legacy_on'
on a database other than Master because I had followed everything else to
the detail.

Anyway, I now have my SQL debugging from VS.NET 2003 applications back and
working and you to thank for!!!

God bless.

[quoted text, click to view]
Geraldo Thomaz Jr.
11/24/2005 1:45:04 PM
I am having the same problem with VS2005 and SQL2005.
But when I executed exec sp_sdidebug 'legacy_on' on the master database but
I got the following message:

Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'sp_sdidebug'.

Can somebody help me?

[quoted text, click to view]
AddThis Social Bookmark Button