Justin Lessard
Justin Lessard

Reputation: 11911

Could not connect to sql server: SQL server Instance failure. (System.Data)

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)

   ...

Upvotes: 3

Views: 14964

Answers (3)

adnan Alyaari
adnan Alyaari

Reputation: 61

i solved it by stoped all server instance and just run the instance i work with it

1- open sql server configuration manager (if not shown in start menu it's in system32 ) .

2- select SQL Server Services you will get all instances that installed in your pc.

3- stop any instance you dont work with it and start the instance that you work with it.

Upvotes: 0

Salih
Salih

Reputation: 17

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.

Upvotes: 2

Justin Lessard
Justin Lessard

Reputation: 11911

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

Solution 1: Change one instance to run on another port.

  1. Open your Sql Server Configuration Manager

  2. Go to SQL Server Network Configuration and select Protocols for YOUR_INSTANCE.

  3. Right-click on TCP/IP => Properties

  4. Change the port from 1433 to another one. I changed it to 1434.

  5. Restart sql server and it should work.

Solution 2: Shutdown one sql instance.

  1. Go to services

  2. Find the instance you want to shutdown.

  3. Right-click => Stop

Upvotes: 9

Related Questions