We have a SQL Server in a remote location. If we access the server from the same location (internal IP, same IP as the server is using) the performance is good. We don't face any problem with connectivity.

But whenever we try to connect from a remote client (public IP) we are faced with a timeout error.

I have made an etc/host entry for the server.

What might be the reasons for such problems?

I have connected via ODBC in Management Studio. The connection has been established. I am facing the problem only when executing queries (any query).

  • Are you connecting, and its slow? Or are you failing to connect with a timeout error? These are two different problems. – RBarryYoung Jul 21 '17 at 14:25

By default SQL Server instances don't listen for TCP/IP connections, so verify that this is enabled:

Also you need to make sure that firewalls between your client and the server are not blocking the connection. For the default instance under standard configuration TCP port 1433 needs to be open. If you have multiple instances then things get more complicated. See https://msdn.microsoft.com/en-us/library/cc646023.aspx for more details.

These are the most common cuases of complete failure to connect to a remote server. If all this is configured correctly then, as Tom V suggests, we need more information in order to be able to help.

Warning: It is strongly recommended that you do not open your SQL server ports to the Internet at large. If you allow connections in from the outside network then make sure you limit it to specific source IP addresses. If you can not do this because the source address(es) are variable (for example if you need to connect from a laptop that moves between networks a lot) then consider instead setting up a VPN to allow access through the firewall that way instead of directly. Even for a single fixed source address, I would still tend to prefer the VPN option.

| improve this answer | |
  • Hi David,Thanks for the suggestion, Let me confirm about the firewall, I can establish the connection but getting issue whenever i execute queries.(Even Simple queries) – U1_R Mar 30 '16 at 9:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.