As a part of my quick consultancy, I was contacted by a client who was having trouble where the application was not able to connect to SQL Server. We all joined the call and desktop sharing to learn more about the issue. We looked into the application and found that the SQL connection from the client application were constantly failing with the following connection error:
[Microsoft][ODBC SQL Server Driver][DBNETLIB][ConnectionOpen(Connect())
We tried below steps to narrow down the issue.
- SQL Server instance which we were trying to connect was a named instance, which was listening on non-default port 2433.
- SQL Browser was running.
- Ping was working fine and we could get the response.
- Telnet to port 2433 was working fine.
- If we connect using SQLMACHINE\INSTANCE_NAME then it fails.
- If we connect using SQLMACHINE,2433 then it works.
At this point we anticipated the UDP port is FILTERED for some reason and hence we are not able to get the instance names mapped to the port numbers.
SOLUTION / WORKAROUND
As a workaround, we went ahead and created the SQL alias for the TCP/IP protocol. Once the alias were created, we could connect to the SQL server successfully using SQLMACHINE\INSTANCE_NAME.
The ideal solution was to make sure the firewall is configured correctly as mentioned in books online Configure the Windows Firewall to Allow SQL Server Access
There could be many other issues of client connectivity and it all depends on error message. Have you encountered a similar error? If yes, what was the solution in your case?
Reference: Pinal Dave (http://blog.sqlauthority.com)