SQL Server 2019 & T-SQL Debugging using Visual Studio

mh53j_fe 1 Reputation point
2021-03-18T12:24:44.37+00:00

Has anybody been successful in configuring SQL Server 2019, Visual Studio, and SSDT to enable T-SQL debugging? I have verified that all ports are open on our firewall but I still get this error: "Unable to start T-SQL debugging, Could not connect to computer <hostname>,1987. The debugger cannot connect to the remote computer. The debugger was unable to resolve the specified computer name." I should note that we are using a non-standard port for SQL Server - 1987. I also installed Visual Studio on the server with SQL Server, and I get the same results. I appreciate any help you can offer on what my problem is or how I can further troubleshoot. Thank you in advance!

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

3 answers

Sort by: Most helpful
  1. CarrinWu-MSFT 6,891 Reputation points
    2021-03-19T05:58:52.74+00:00

    Hi @mh53j_fe ,

    SSMS needs to be able to find your SQL Server by DNS. When you connect to the DB in SSMS, you can use (local), but (local) does not resolve on your network so the debug program can not find it. Try connecting to localhost or your computer's name on the "Connect to Server" screen. You should not have to run as administrator. Quoted in Unable to start T-SQL Debugging. Could not connect to computer (“*****”)

    79522-a.png

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. CarrinWu-MSFT 6,891 Reputation points
    2021-03-23T01:46:34.223+00:00

    Hi @mh53j_fe ,

    Try below steps. For the details, please refer to Unable to Connect to the Microsoft Visual Studio Remote Debugging Monitor

    80436-debugger.png

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Per Schjetne 1 Reputation point
    2021-06-18T19:26:35.87+00:00

    I had the same issue and it was solved by using the default 1433 port on the instance. The problem arises when you use a custom port for SQL Server. Not optimal for us as we want to use custom ports, so if anyone have a solution please share.

    0 comments No comments

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.