A network related or instance-specific error occured while ... (provider: SQL Network Interfaces, error:26

Claire van Koppen 21 Reputation points
2021-10-14T15:51:32.067+00:00

Cannot connect to .....\SQLEXPRESS

A network related or instance-specific error occurred while establishing a connection to the SQL Server. The server was not found or was not accessible.
Verify that the 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)(Microsoft SQL Server)

This is the error I get when trying to connect from an Azure VM with SQL Express installed, using SSMS, to a local database on my laptop while being logged onto the VM using VPN and RDP. I can connect from my laptop to an SQL Express instance on the Azure VM when the VPN is connected.

Any body have any idea how I can connect from the VM to a database on my laptop as the data stored in the SQL database on the Azure VM needs to be transferred to my laptop on a schedule.

Thanks,

Azure SQL Database
0 comments No comments
{count} votes

Answer accepted by question author
  1. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2021-10-14T21:12:28.03+00:00

    One option is to expose your SQL Server instance on the Internet - but don't do that. That is an awfully bad idea.

    Else you will need to get the laptop on the same network segment as the VM, that is on the same VPN. I am not sure that is doable, but a start is to open a command-line window on both laptop and VM and run ipconfig to see if you have any networks in common.

    If you have, you should be able to connect with n.n.n.n\SQLEXPRESS, but you will need to open ports in your firewall. And you will need to make sure that your instance accepts remote connections. By default, communication over TCP/IP is disabled for SQL Express. You also need to change the Browser service to run with auto-start

    But, again, if you don't have any common network between laptop and VM, this is pointless.

    I think that it would be better that the laptop goes and speaks with the VM. Not the least if the VM is up all the time, while your laptop may not.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. CathyJi-MSFT 22,406 Reputation points Microsoft External Staff
    2021-10-15T02:01:48.05+00:00

    Hi @Claire van Koppen ,

    Could you connect to your local SQL server instance through local SSMS successfully? Did the laptop on the same network segment as the VM? Please also check below things;

    1.Make sure your server name is correct, e.g., no typo on the name and no an extra space in the instance name or server name.
    2. Make sure SQL Browser service is running on the server.
    3. If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
    4. Make sure SQL Server is configured to allow remote connections


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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. Thin Thuzar Oo 5 Reputation points
    2023-01-11T08:22:29.19+00:00

    Untitled

    When you connect using Microsoft Management Studio, please type the port no 1433.

    Try Telnet command for 1433 also. In cmd.exe, type this command to check whether port 1433 is on : Telnet IPaddress or PC name 1433 (eg: Telnet 192.168.1.160 1433).

    If cmd shows black screen, the port is opening.

    please turn on Telnet Client in Win10 using Windows features on or off in Control panel.

    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.