Home » MS Office

Error Connecting to Server Using SQL Server Management Studio

Hello all,

I am trying to connect to a SQL Server 2005 instance using SQL Server Management Studio and I am receiving the following error message.


Cannot connect to VTWIN.


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) (.Net SqlClient Data Provider)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476

Error Number: 53
Severity: 20
State: 0

Program Location:

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
   at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

I am connecting using windows authentication. I made sure that remote connections are enabled using tcp and named pipes. The server is running. The default port for TCP/IP is 1433. Does anyone have any ideas on what could be wrong?

Thanks in advance.


10 Answers Found


Answer 1

There are some basic steps to check here


1. Make sure the firewall is open for incoming request. Telnet the port 1433 on the SQL server  machine from your local machine

2. If you are connecting  to a named instance check if sql  browser service is running.

3. Also make sure the SQL services are running.

Thanks, Leks

Answer 2


As per the error  message "the server  was not found or was not accessible", the sql  server is not available for management  studio.

Are you trying to connect  named instance?. if so, please try to connect db server like servername\instancename.

and also let me know your system os.


Answer 3

I am connecting  to the default instance. The os Windows Server 2003 Standard Edition SP2


Answer 4

When I try to telnet I get an error  that says "Connection closed by remote host."

I am using the default instance.


Answer 5


It seems to be firwall issue. Check with support team for firwall issue.


Answer 6

Hi keesh99,


From my understanding, you met error  ‘Connection closed by remote host’ when you troubleshot your SQL server  connection issue. Is this correct?


Based on my internal research about the error message, we recommend you to disable TCP Chimney, and also disable SynAttackProtect, if you are using the operating system(OS) Windows 2003, and sql  Server is installed on the server with this OS. That’s could be one solution for your problem.


To disable TCP Chimney, please try the following steps:

        1)  Launch regedit.exe

        2)  Goto HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

        3)  Set three REG_DWORD values:EnableTCPChimney, EnableRSS and EnableTCPA from 1 to 0

        4)  Restart Windows Server 2003


To disable TCP Chimney, please try the following steps:

        1)  Launch regedit.exe

        2)  Add DWORD value named SynAttackProtect under registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\

        3) Set data value to 0

        4) Restart Windows Server 2003


Would you please take a look at the following good links, they are very useful for connection problems:

SQL Server Intermittent Connectivity Issue:http://blogs.msdn.com/b/sqlprogrammability/archive/2008/05/27/sql-server-intermittent-connectivity-issue.aspx

Steps to troubleshoot SQL connectivity issues:http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx

Error message when an application connects to SQL Server on a server that is running Windows Server 2003: "General Network error," "Communication link failure," or "A transport-level error":http://support.microsoft.com/kb/942861


If there are more questions, please feel free to ask.





Answer 7

@Grace Liu

I tried your suggestion and it was unsuccessful.

@Ramesh S

My support team has informed me that it is not a firewll issue.


Answer 8

Hi Keesh99,

I have faced similar issue and finally i got raid the same with network team help. He did some modification in firewall and able to connect  db server.

Inform them to monitor firewall log another 15 minutes and try to connect sql  server.



Answer 9

Have you tried connecting  to it using the IP Address instead of the name?



Answer 10

Can you ping the server?


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure