1
votes

i am trying to connect with Azure SQL database using SSMS but i am getting the bellow error message

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

We had enabled all the necessary ports also restart the SQL server, added client 'ip' in Azure firewall settings. previously we are able to connect but we changed the location of our Azure SQL server after that we are not able to connect but i can connect to another server which is located at the different location.

1
is it a sql server on a vm?4c74356b41
Firewall blocks an outgoing connection on a client side?Alexander Volok
Are you using Azure SQL Database or running SQL Server on a VM in Azure? In either case, this looks to be a network connectivity issue. Run this powershell command on the problem client to verify low-level connectivity to the remote IP and port: powershell -Command echo ((new-object Net.Sockets.TcpClient).Client.Connect('your-azure-database-server.database.windows.net', 1433)) 'success'Dan Guzman
You cannot restart an Azure SQL Database. Please let us know if you have an Azure SQL VM (IaaS)?Alberto Morillo
Is your database located in West Europe now?Alberto Morillo

1 Answers

0
votes

I found this article: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server (Microsoft SQL Server, Error: XXX) may give you some useful messages.

Basically, this error message just tell you that the client cannot make a connection to the server. It's equvalent to "SQL Server does not exist or access denied" in MDAC. Although the error message say about Named Pipe Provider, the issue does not have to be NP related. The reason is that, by default, the client stack try TCP and NP in order. If the connection attempt could not success with any of them, then NP is the last protocol tried and this is the error message to present to users.

When users see this error message, sometimes xxx is omitted. But actually, xxx is the most important part of this error message. xxx is Windows error code and it gives customer hints about why the connection fails. Here are some error code users often see. I also explain the root cause and possible solutions here.

1) xxx=53

winerr 53 means "The network path was not found". If you got this message, it means the client stack cannot find the target machine.

Here are possible reasons for this failure:

a. typo in the server name, or using "/" rather than "" between server name and instance name, e.g. "myserver/myinst" is not correct.

b. name resolution to the server name is not correct, "ping -a yourserver" would tell if that's the case.

c. The server machine is firewall'ed and file sharing is not in the exception list. You need put "File and Printer Sharing" in exception.

Hope this can helps you.