SSMS debugger out of sync with code

Nick Ryan 261 Reputation points
2022-08-24T20:44:29.67+00:00

This question has been asked before: ssms-debugger-out-of-sync-when-stepping-through-code

I have followed the recommendations there but my debugs are still out of step. I ran DROP and CREATE on my SP then stopped and restarted SSMS (2016). I then stepped into my stored procedure and the code is aligned for the top part but if I scroll down, at a certain point in the code, it is no longer aligned. I select a line for a breakpoint and when I click add, it highlights a block of code that isn't just the instruction I selected nor is it whole lines.

Are there any other tricks that may help?

Developer technologies Transact-SQL
SQL Server Other
{count} votes

1 answer

Sort by: Most helpful
  1. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2022-08-25T02:51:34+00:00

    Hi @Nick Ryan ,

    > stopped and restarted SSMS (2016)

    As fa as I know, last supporting debugging SSMS version is 17.9.1, suggest you using it, you can get it from here. If it is still not work, you can easily connect to SQL Server from Visual Studio and perform Debugging on Stored Procedures after connecting the server. Please refer to below blog to get detail steps.
    234743-capture.png

    How to Debug Stored Procedures in SQL Server using Visual Studio 2019


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.