How is remote debugging allowed on Microsoft SQL Management studio?

Xarzu 1 Reputation point
2021-08-29T17:17:41.917+00:00

This is working with Sql Server version 2008 R2

Here are the other versions of software that might be helpful:

https://www.sqlservercentral.com/wp-content/uploads/hm_bbpui/3924844/dtrwhu4y2axnms3w5lvemj1q0byz1z42.png

How is remote debugging allowed on Microsoft SQL Management studio?

This question might be misunderstood. I am not sitting at the computer where Microsoft SQL Managment studio resides and I am attempting to debug a remote database. That is not the issue I am having at all. Instead, I have remoted into a client's server by their request and also I am trying to debug an issue they are having. You see, this is how things are evolving in our world. More and more there are situations where a developer is working from home and has to remote into a client's system do get some work done.

When I open up their studio software on their side, if I try to debug or execute a command, I get this error message:

https://i.stack.imgur.com/5kprj.png

I want to be able to instruct them, on their side, what they need to do to make this problem go away. Please advise.

SQL Server | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 129.4K Reputation points MVP Volunteer Moderator
    2021-08-29T18:34:33.84+00:00

    I gave up on the debugger many years ago. I found that I spent more time to get it working than I gained from using it.

    Generally, it works with your local instance. Less so if SQL Server runs on a different machine. There are firewall ports that needs to be opened, including the rpc port, and that's not one to open if you think the firewall actually serves a purpose. And that firewall port is only the start of it.

    What I do to debug my SQL code? Debug PRINT and SELECT. Occasionally I also use sp_sqltrace.

    I also like to point that running the debugger against a production environment is definitely not appropriate, as you could be holding locks for a longer time that is suitable when you single-step through a procedure.

    Finally, in the more recent cadence of SSMS, SSMS 18, the debugger is gone.

    0 comments No comments

  2. CathyJi-MSFT 22,406 Reputation points Microsoft External Staff
    2021-08-30T08:16:06.933+00:00

    Hi @Xarzu ,

    To run the Transact-SQL debugger when connected to a remote instance of the Database Engine, program and port rules in the Windows Firewall must be enabled on both computers. There are also some requirements for Starting the Debugger.

    Please refer to below MS documents to get detail information.

    Configure firewall rules before running the TSQL Debugger
    Configuring the Transact-SQL Debugger


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.

    0 comments No comments

  3. Tom Phillips 17,781 Reputation points
    2021-08-30T14:29:45.69+00:00

    As Erland said, ignore the option and just run your TSQL in the query window.

    0 comments No comments

Your answer

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