T-SQL Debugging on VS2005/SQL2005

Hello,

I can't seem to debug an SQL stored procedure using VS .Net's 2005 debugger.

When I Step into stored procedure the breakpoint turns to a question mark and 
says "The breakpoint will not currently be hit. 
Unable to bind SQL breakpoint at this time. 
Object containing the breakpoint not loaded".

VS2005/SQL2005 are on the same machine running Win2003 Sp1/R2

Thanx for the help



Answer this question

T-SQL Debugging on VS2005/SQL2005

  • Sachit Kachraj

    Actually i am trying to debug SQL2005 T-SQL stored procedures from VS2005.
  • Henry Zhang

    No, the problem wasn't fixed yet, and it's very annoying.
  • .NET Installer

    I'm also having this problem. I hope we get some resolution on this soon.

  • boone10

    Have you fixed it I've the same problem, may be there are some hints for you: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=310673&SiteID=1
  • markusp

    Vlad,

    Looks like you have the right privileges to debug stored procedures on SQL Server 2005. Could you clarify for me whether you are able to stepinto stored procedures or not The message about the breakpoint is itself valid in that breakpoints aren't bound until that stored proc is about to be executed. You can think of it as like waiting for a modload event before breakpoints get bound as in the case of managed or native debugging.

    Please include anything in the ouput window and eventlog after attempting a stepinto. Also are you able to execute the stored procedure Thanks.


  • Scott Munro

    Vlad,

    The way SQL debugging works against SQL Server 2005 and earlier versions is quite different. Is the account being used to launch VS an admin on the box What credentials are you using to connect to SQL Server 2005 i.e. does it have SA role By default members of the Administrators group have SA role. So if you are using Windows authentication and the account is in Administrators group you have permissions to debug.

    Azeem.

    Visual Studio Debugger.


  • JMiller99

    Azeem,

    do you have any news for us


  • felix21685

    You can not debug into SQL Server 2000 stored procedures or anything else within Visual Studio 2005. Even though this was a capability they supported in VS 2003, they deceided to take this away because: "it was too difficult to do with the increased security of the newer service packs and software releases... -- Microsoft Technical Support"

    I spent $245 on an incident with Microsoft to find this out.

    You can debug into SQL Server 2005 database objects with Visual Studio 2005. Humm.... Maybe I should upgrade my database to a new license for SQL Server 2005.

    This is the same thing I was experiencing when I started this incident.

    If you have upgraded and this is still not working then maybe I need to reopen the incident.

    Feel free to let me know.


  • Chard-Fi

    That's what output shows.

    Auto-attach to process '[876] [SQL] ctowsca' on machine 'ctowsca' succeeded.
    The thread 'ctowsca [58]' (0xe50) has exited with code 0 (0x0).
    The thread 'ctowsca [58]' (0xe50) has exited with code 0 (0x0).
    The thread 'ctowsca [58]' (0xe50) has exited with code 0 (0x0).
    The thread 'ctowsca [58]' (0xe50) has exited with code 0 (0x0).
    Running [dbo].[spPaintMaterials] ( @fk_order = 586 ).

    From this point clicking "Continue" or "Step Over" would result in
    Finished running [dbo].[spPaintMaterials].
    The thread 'ctowsca [58]' (0xe58) has exited with code 0 (0x0).
    The program '[876] [SQL] ctowsca: ctowsca' has exited with code 0 (0x0).

    Executing this SP on different connection (i.e. from SQL Management Studio) just executes it straight.
    I don't see how to execute this SP from within VS2005 - Test.sql script that contains EXEC statement for this SP cannot be executed while in debug mode, i guess..

    Connection string looks like this:
    Data Source=XXX;Initial Catalog=XXX;Integrated Security=True;Pooling=False;

    Thanks


  • Obliterator

    I don't know if this helps anyone, but I could not step through stored procedures at first. Then I discovered that if I closed all my projects and then loaded the code for the stored procedure from Server Explorer, then I could step through the code. I hope this helps.

  • Craig McLuckie

    I am having the exact same problem...

    This simple test didn't even work... I have a simple database in my app_data folder and a have a simple store procedure in it like this:

    ALTER PROCEDURE dbo.HelloWorld
    @mymessage nvarchar(50) --Breakpoint here

    AS
    PRINT @mymessage --Breakpoint here

    When I do I "step into procedure" into this sp, it naturally asks me the @mymessage variable value and then it doesn't break at the breakpoints.

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

    Why is this happening

  • bajaexplorer

    Hi Mac,

    sorry for asking again: Have you heard about problems with debugging on -explicit- windows server 2003 plattforms

    How i've writte before: Debugging in combination VS 2005, SQL 2005 on Win Server 2000 works fine, i am told.

    J-Mac wrote:

    Even though this was a capability they supported in VS 2003, they deceided to take this away because: "it was too difficult to do with the increased security of the newer service packs and software releases... -- Microsoft Technical Support"

    I spent $245 on an incident with Microsoft to find this out.


  • SmokeNMirrors

    Azeem

    The account being used to launch VSis domain Admin.
    Credentials used to connect to SQL2005 are the same.
    All connection strings are set to use Windows Authentication.

    Thanks


  • Naresh Bhatia

    Nope, haven't heard of this yet... and unfortunately no enviroment to try it
  • T-SQL Debugging on VS2005/SQL2005