none
Connection Error

    Question

  • Hi,

    I keep getting the infamous generic error 

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider)

    when trying to connect (from my machine) to an SQL Server located at another machine within the private network.

    I've already tried all the obvious and well-known solutions, with no success. From other computers using the same network I can connect without any problems, so it's probably something on my machine.

    The weird thing is I work with that server for years and never had this problem, started a few weeks ago, without me changing any configuration. And even more weird is that I can ping the machine normally, the DNS is caching its name and after multiple sequential pings, it suddenly connects. Then, after some minutes of inactive, the error is thrown again.

    Can anybody help me with that?

    Thanks.

    Thursday, December 6, 2018 3:26 PM

All replies

  • Hi TheMFernandes,

    >>provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

    Please check that SQL Server Browser Services is enabled and you have opened UDP 1434 port which is used by Browser Services in the Windows firewall. You can run sqlcmd –L to see if you can find the SQL Server instance in your local network and use telnet <name><port> to verify connectivity to SQL Server. Also please share more information about the issue for further analysis.


    Best Regards
    Puzzle
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, December 7, 2018 2:41 AM
  • With your tips and using portqry I was able to find out what's the problem e come up with a workaround, I just don't know how to solve it.

    Basically when I try to connect using <serverName>\<instanceName> my request arrives at the server that asks SqlServerBrowser for the respective instance port, the server then tries to send a UDP to my machine with the answer but for some reason my machine doesn't get it, and the connection times out.

    I have no idea why my machine is somehow blocking or refusing this package.

    Fortunately, I'm being able to connect using <serverIP>,<instancePortNumber>, but this is not a definitive solution.

    Any thoughts?

    Thanks.

    13 hours 33 minutes ago
  • Hi,

    >>the server then tries to send a UDP to my machine with the answer but for some reason my machine doesn't get it, and the connection times out.

    It indicates that the instance is not working because UDP 1434 is blocked. When SQL Server clients request SQL Server resources, the client network library sends a UDP message to the server using port 1434. Please make sure UDP 1434 is opened. And use <serverName> and <serverName>\<instanceName>,<PortNumber> to see if it can work.

    Note: TCP 1434 is for the Admin connect on the default instance. It is not safe to open it if you are tyring to connect the remote server through Internet. Also there are many ISPs block UDP 1434 to avoid port scaning finding SQL Servers.

    Here is a similar scenario. See if it can help.

    Cannot Connect to Remote Named Instance of SQL Server


    Best Regards
    Puzzle
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    3 hours 7 minutes ago