I get this error message when I try to connect to Sql Server
===================================
Cannot connect to **SQL_ServerName**.
===================================
Instance failure. (System.Data)
------------------------------
Program Location:
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, Boolean isFirstTransparentAttempt, SqlAuthenticationMethod authType, Boolean disableTnir)
...
The issue was I had two SQL server instance on the same machine.
Both instances were listening to connection on the same port, as describe in this forum
Open your Sql Server Configuration Manager
Go to SQL Server Network Configuration and select Protocols for YOUR_INSTANCE.
Right-click on TCP/IP => Properties
Change the port from 1433 to another one. I changed it to 1434.
Restart sql server and it should work.
Go to services
Find the instance you want to shutdown.
Right-click => Stop
If you have got 2 instances, you take this error. I have MSSQLSERVER and SQL2005 instance name. And after windows server 2008r2 restart, the MSSQLSERVER is working but my default instance SQL2005 is not working. I check the system event log. It says about TCP connection is working another program or service. And I stopped MSSQLSERVER and my default instance SQL2005 started normally... This is port sharing problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With