I am getting the error:
"The breakpoint will not currently be hit. Unable to bind SQL breakpoint at this time. Object containing the breakpoint not loaded"
When I did the steps to debug a stored proc called from my .net app?
What should I be checking?
(VS 2005 and SQL Server 2005 both running on the same PC, I can debug a stored proc if I do "step into" from the Server Explorer)
Start by going to the Server Explorer and expand the Northwind database node. Next, drill down into the Stored Procedures folder, right-click on the Products_SelectByCategoryID stored procedure, and choose the Step Into Stored Procedure option from the context menu. This will start the debugger.
To debugging SP, go to database->Programmability->Stored Procedures-> right click the procedure you want to debug->select Debug Procedure.
Make sure that in the project properties > Debug > 'Enable SQL server debugging' checked otherwise you won't be able to step into a stored procedure from your .net code (even though you can step through it using server explorer). Has to be the executing project.
If you're calling the stored procedure from a SqlCommand, set a break point on the Command.Execute() line and then step into it. From there you will be taken to the stored procedure code and will be able to walk through it.
If you continue to get the empty breakpoint icon, try refreshing server explorer.
In addition to enabling SQL Debugging on the project, like DustinDavis said, I had to select "Allow SQL/CLR Debugging" in the context menu for the server in SQL Server Object Explorer (Visual Studio 2015). See How can I step into a SQL Server stored proc from my C# code?
Also make sure both the user account under which VS runs and under which your application connects have sysadmin privileges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With