SQL Server 2005 connectivity error messages


One of the more visible changes we made in connectivity space for SQL Server 2005 was enhancing error messages reported to the user in case of connection failures.  I have seen several cases over the last several months, and in this post I would like to list some of them with the root cause that caused them.  The cause may not be the only one triggering a particular error message, and there may be other error messages of interest. 

This is a semi-random selection from real cases I investigated.  Likely I will post another batch some time in the future, and I would be happy to see replies with additional errors, particularly if the root cause is unclear. 

The examples are from various client stacks – ODBC or OLEDB from SQL Native Client or from managed SqlClient. 

The exact formatting of the messages will depend on the application you use.  Most of the examples below used OSQL, SQLCMD, or SQL Server Management Studio. 

  • Connecting to a server by the server’s name from SqlClient, the server name is aliased to TCP, the server is up and running but it does not listen on TCP (or is not running at all):

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

  • Local connection from SqlClient; server is not running:

(a) default instance:

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

(b) named instance:

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

  • Remote connection from ODBC, Windows Firewall is turned on on the server machine but there is an exception for File and Printer Sharing:

 [SQL Native Client]Unable to complete login process due to delay in opening server connection

  • A successful TCP connection from SqlClient to the server was broken due to a TCP keep-alive heartbeat failure (typically indicating problems with the underlying network infrastructure):

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The specified network name is no longer available.)

Possibly:

A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.)

  • OBDC connection attempt when server is not ready to process a new local connection, possibly due to overload: 

[SQL Native Client]Shared Memory Provider: Timeout error [258].
[SQL Native Client]Login timeout expired
[SQL Native Client]Unable to complete login process due to delay in prelogin response

[SQL Native Client]Shared Memory Provider: Could not open a connection to SQL Server [121].
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

  • There is a space after server name in the connection string:

osql -E -S “<serverName> ,1433”
Login failed for user ”. The user is not associated with a trusted SQL Server connection.

The server ERRORLOG/EventLog shows something similar to:

2005-08-11 12:46:04.29 Logon       Error: 17806, Severity: 20, State: 2.
2005-08-11 12:46:04.29 Logon       SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: <IP address>]
2005-08-11 12:46:04.29 Logon       Error: 18452, Severity: 14, State: 1.
2005-08-11 12:46:04.29 Logon       Login failed for user ”. The user is not associated with a trusted SQL Server connection. [CLIENT: <IP address>]

  • Remote OLEDB connection using TCP to a server that is blocked by Firewall

HResult 0x274C, Level 16, State 1
TCP Provider: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Error: Microsoft SQL Native Client : Login timeout expired.

  • Remote OLEDB connection using TCP to a server that is either not running or does not have TCP/IP protocol enabled for incoming connections (but is not blocked by the Firewall on the server machine):

HResult 0x274D, Level 16, State 1
TCP Provider: No connection could be made because the target machine actively refused it.

Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Error: Microsoft SQL Native Client : Login timeout expired.

Peter Gvozdjak, SQL Server Protocols

Disclaimer: This posting is provided “AS IS” with no warranties, and confers no rights


Comments (254)

  1. Joe SQL says:

    What is the value of this blog? You’ve posted the error messages – likely the messages we are seeing – but there are no suggested resolutions.

  2. SQL Protocols says:

    This is a quick list compiled from the early Beta experience with SQL Server 2005. To get it out quickly I tried to list at least the root cause. I plan to update it with resolutions and more error messages moving forward.

    If you encountered any specific message, can you let me know?

    I will be glad to work with you on resolution, an updating this blog accoprdingly.

    You may also want to check additional blogs posted by Ming Lu from our team, which contain resolution to many of the connectivity problems:

    http://blogs.msdn.com/sql_protocols/archive/2005/10/22/483684.aspx

    http://blogs.msdn.com/sql_protocols/archive/2005/10/29/486861.aspx

  3. Lunchbox027 says:

    I’ve been getting the following message when trying to run Management Studio Express and also a similar error with Altiris Depoloyment Solutions for Clients 6.5 trying yo connect to SQL Server Express.

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

    My TCP/IP and Named Pipes are both enabled, I’ve reinstalled everything several times with no luck. I’m just a Tech, and still learning my way around databases so there might be something simple that I missed. 😛 My boss has only had a couple minutes to help me out and he couldn’t come up with anything. Any info you could give would be greatly appreciated, and I will keep you updated as to my failures/success so you can help build your FAQ.

  4. SQL Protocols says:

    Error[provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it] indicates that your TCP/IP was not enabled or your sql server was not listening on the appropriate port.

    1) After installing SQL Express, by default, TCP/IP was disabled, please see http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx to enable remote connection for SQL Express.

    2) Please check errorlog to make sure server TCP was enabled.

    – Key words indicates server TCP/IP is enabled –

    Server is listening on [‘any’ <ipv4> <Port Number>] or

    [ <ipaddress> <ipv4> <Port Number>].

    First one is when enabling server “ListenonAllIPs”, and second one is when server listening on individual IP. To further verification, you can test whether sql server is listening on the exact port using "netstat -ano| findstr <PortNumber>".

    3)Try to connect to the exact port that server was listening on and see what happens.

    If you still face the same problem, please attach your errorlog info and your connection string(eg, you connect through "."/"(local)"/<hostname>, etc.. and whether you specified any protocol prefix(eg, lpc:/np:/tcp:).

    Thanks

    Ming.

  5. Bob Anderson says:

    I’m seem to be having an upgrade issue. I have upgraded my client tools to 2005 and am trying to connect to an existing SQL Server 2000 box. I have a named data source pointing to a port on my local machine which is then forwarded through an SSH connection. The 2000 client tools had no trouble connecting; I also have no trouble connecting via a Perl script, but I can’t connect using Management Studio. I get the first error you have listed above.

    Any ideas what the problem might be? Thanks

  6. SQL Protocols says:

    Hi, Bob

    As Peter mentioned in the blog, your sql server might not listen on TCP port properly under this situation.Please follow below steps to troubleshoot:

    Go to Server Network Utility, if you enabled TCP on the server,you can see TCP/IP is in the "Enabled Protocols" and click properties of it, get which port configured,then

    1)netstat –ano |findstr <PortNum>

    2)go to server ERRORLOG see whether server is listening on TCP protocol,you should see "SQL Server is listening on TCP" in the log.

    3)or use c:Program filesMicrosoft SQL Server90toolsbinnosql /S<Instance>,<PortNum>, see what happens.

    4)It sound that you connect to SQL Server using alias, so, please go to SQL Server Client Network Utility,choose "Alias" tab, check whether you configured the same port that server was listening on in the TCP Alias properties.

    If you still have further question, please attach the log file and the connection string( how do you make connection).

    Thanks!

    Ming.

  7. SqlRick says:

    This may be plain silly, but I was struggling with this for 30 minutes because I used a small -s instead of a large -S when specifying the server. You get this connectivity error message instead of a command syntax message and believe your network connectivity is the issue.

  8. SQL Protocols says:

    if you try "osql /?" or "sqlcmd /?", you will see:

    -S:server

    -s:colseparator

    Hence, if you make connection like:

    "OSQL /s<machinename> /E" it equals to "OSQL /S /E" without specify server and by default it make connection to local default instance.

    Thanks!

    Ming.

  9. Junifer says:

    Hello guys,

    I just downloaded and installed the VWD 2005 Express Edition, i followed the tutorial on the msdn until i got this exact error:

    An error has occured while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be cause by the fact that under the default setting SQL Server does not allow remote connections.(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Sever)

    Sorry but i’m in .net i am a asp developer for years now but i use msaccess so no experience in SQL Server.

    Thanks,

    Junifer.

  10. SQL Protocols says:

    If you need to access the SQL Server back-end from a remote machine you need to enable remote connections.  See this for a reference:

    http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx

    Thank you,

    Peter

  11. Nitin says:

    I am getting the following error while i try to open a SqlConnection(using  C#) if the SQl Server is paused.

    Source : .Net SqlClient Data Provider

    Message : A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 – The system cannot open the file.)

    The error number for this err is 4. (SqlException.Number)

    However if the open this connection again then i get the following error

    Source : .Net SqlClient Data Provider

    Message : SQL Server has been paused. No new connections will be allowed.

    Login failed for user ‘(null)’.

    So this is correct and the error number for this is 17142.

    So my question is why does i get the error number 4 in the first place and the subsequent runs gives the correct error.

  12. Vitgar says:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

    to correct this error in SQLEXPRESS on servername use [servername]sqlexpress, this should work

  13. Aji Jose says:

    Please give me a solution for the following error, which occured when i am trying to connect  sql server2005 from remotely.

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 28 – Server doesn’t support requested protocol) (Microsoft SQL Server, Error: -1)

  14. angi says:

    Please give me a soluten for the following error when trying to open the migrated DTS-Packages from SQL Server 2000 on the MSDB-Node/Refresh:

    TITLE: Microsoft SQL Server Management Studio

    ——————————

    Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)

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

    ——————————

    ADDITIONAL INFORMATION:

    Login timeout expired

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

    Named Pipes Provider: Could not open a connection to SQL Server [2].  (Microsoft SQL Native Client)

    ——————————

    Login timeout expired

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

    Named Pipes Provider: Could not open a connection to SQL Server [2].  (Microsoft SQL Native Client)

    ——————————

    BUTTONS:

    OK

    ——————————

  15. Gokul says:

    hi, i get this error when i run my project. i am using a remote server. it is running. but i am getting the error when i am adding a webpart to the page. otherwise it is running fine. do clear my bug. thanks.

    gokul.

  16. SQL Protocols says:

    If the error message contains the string "SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified" it is most likely caused by one of the two following causes:

    (1) The SQL Browser process is not running on the server box.  

    and/or

    (2) The SQL Browser’s UDP port 1434 is blocked by firewall.  You can grant exception either to UDP port 1434 or to SQL Browser process.  

  17. Shahid says:

    Can someone please help me with this error.

    ===================================

    Cannot connect to CNF52307XV.

    ===================================

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (.Net SqlClient Data Provider)

    ——————————

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

    ——————————

    Error Number: 10061

    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(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)

      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()

  18. SQL Protocols says:

    Shahid,

    This error suggests that (a) your client specifies to use TCP but (b) your server is not listening on the TCP protocol but (or at least not on its default port).  

    Regarding (a): the TCP protocol is most likely specified in the connection string or in an alias with the name of the target server.  Is your intent to use TCP?  

    If yes, we get to part (b).  Most likely you need to enable the TCP protocol on the server, and retsart the server.  Instructions on how to do this for SQL Express are in http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx.  The steps are the same for other SQL Server editions, just "Click on the Protocols for MSSQLSERVER" instead of "SQLEXPRESS" if your server is installed as a default instance (or for the appropriate instance name if it is a named instance).  

    Peter

  19. Saeid says:

    Hi

    When i install Sqlserver Express it doesn’t ask about Default or Instance Setup. After installing it connect as ServerNemaSQLEXPRESS

    I want to change connection name to just ServerName. What should i do?

    Thank you for helping me.

  20. SQL Protocols says:

    Hi, Saeid

     By default, SqlExpress was installed as a named instance and with TCP and Named Pipe are disabled.

     You can not change a named instance to a default instance, if you really want to use only servername in the connection string, you can spcify the tcp port like "Server=<machinename>,<port>" after you enabled Tcp; but if you only want to use shared memory or named pipe, we suggest you keep using "Server=<machinename>sqlexpress".

    Here is useful info for SqlExpress

    http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

  21. SQL Protocols says:

    And if you really want to access it through Server=<machinename> you can create an alias through SQL Server Configuration Manager with the name of the machine connecting to your SQL Express.  

    Thanks,

    Peter

  22. Aaron Gregory says:

    Has anyone tried accessing a SQL 2005 Enterprise from a local machine with Symantec Client Firewall (v 7.1.0) installed?  When trying to update diagrams locally, I get the following message with the firewall enabled:

    "A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.) (.Net SqlClient Data Provider)"

    * * *

    Of course, when disabled, I am able to update diagrams.

    Does anyone know of a workaround to update diagrams locally with the firewall enabled?  Or, is that just a pipedream?

    Thanks.

  23. SQL Protocols says:

    Try specifying the server by its loopback IP address, 127.0.0.1 in the IPv4 case.  And let us know the result.  

    Thanks,

    Peter

  24. SQL Protocols says:

    Alternatively, you can use a protocol other than TCP (Shared Memory and/or Named Pipes) if you have it enabled on your SQL Server.  By default SqlClient first tries to use Shared Memory on a local machine.  

  25. Christopher Cheng says:

    For those who gave up, try one more thing:

    Start "SQL Server Configuration Manager",

    In "SQL Server 2005 Network Configuration" > "Protocols for SQLEXPRESS", Click on the tab "IP Addresses", Change all TCP Port to 1433.

    Yes, I mean all, even "IPAll", then it will work!

  26. Daryl says:

    I am getting a very troublesome error using SQLExpresss 2005.  I had a developer write an application utilizing SQLExpress 2005, and I can connect to the server, view all the data (customers, orders, setup tables, etc.), I can connect to the database via Access (ODBC), everything works fine until I try and print an order.  Then it comes up and says "An error has occured while establishing a connections to the server.  When connecting to SQL Server 2005, this failure may be cuased by the fact that under the default settings SQL server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server).  I have enabled remote connections, both TCP/IP and named pipes, made sure that both loopback and actual machines IP address are not only active, but enabled, and like I said previously, am able to view & update data through application, but can seem to print.  Not sure what is going on.  ANY help would be greatly appreciated.  Thanks in advance.

  27. Matt Neerincx [MSFT] says:

    You need to contact the developer who wrote the Access application.  The report you are trying to print is referencing an old linked table most likely.  Open the report in design view and select View|Properties and look at Record Source property, this might give you a clue.  But in general the report could be referencing an old linked table just about anywhere so you have to dig through the report in design view until you find it.

  28. I also have this error message:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

    …And I disabled de firewall, added SQLSERVER to Firewall exceptions, executed aspnet_regsql.exe to add the instance and nothing… configuring in options of visual studio environment to setup the instance of SQL Server 2005… I have this backgrouds: I have installed SQL Server 2000 and Visual Studio .NET 2003 and I have not SQLEXPRESS Edition but SQL Server 2005

    What should I do??

    Thsnks a lot…

  29. Paul Nguyen says:

    If you are trying to remote connection to Sql Server 2005, you need to enable your TCP/IP Protocol in your SQL Server Configuration Manager.

    SQL Server Configuration Manager

    -> SQl Server 2005 Network Configuration

      -> Protocols for <instance>

    After enabling the TCP/IP, you need to restart the SQL Server for the changes to be in affect.

  30. JInn says:

    When my PC connecting the SQL Server 2005,

    the Error occurred as follows:

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005,this failure may be caused by the fact that under the default setting SQL Server does not allow remote connections.(provider:Named Pipes Provider,error:40 – Could not open a connection to SQL Server)(Microsoft SQL Server,Error:53)

    But others pc could connect it!

    The TCP/IP is enabled state and Named Piped is enabled state

  31. Srinivas says:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

  32. SQL Protocols says:

    Jinn,

    Error code 53 often indicates that the server is not reachable from the client machine.  If you run the following two commands on the client machine, what do you get (I assume the server is installed as a default intsnace):

    telnet <serverMachineName> 1433

    ping <serverMachineName>

  33. SQL Protocols says:

    Srinivas,

    Are you able to retrieve the Number member of the SqlError objact in the SqlErrorCollection contained in the SqlException thrown?  

  34. Andrew says:

    Does anybody know how to fix the following:

    Unable to complete login process due to delay in

    prelogin response.

    This seems to happen every 1-2 hrs and we have to restart the SQL service, then it is fine.

    We usually use tcp/ip for our connections.

    When the server starts refusing connection on tcp/ip, we can still connect using namedpipes or the dedicated admin port (tcp 1434).

    A few sites mention the erro but no-one can suggest a fix or even further routes for investigation.

    Thanks in advance

  35. Koterpillar says:

    "An error has occurred while establishing connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: HTTP Provider, error: 0 – )"

    This occurs randomly, but always under heavy _client_ load. I suppose client first tries some other "provider", but fails, and HTTP provider isn’t configured.

  36. Lil Turtle says:

    I am getting the following error when trying to run an ASP.NET 2.0 application using a connection to SQL Server 2000,

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 – Could not open a connection to SQL Server)

    I don’t understand why the application is trying to connect to SQL 2005 server when it is not specified.

    Thanks.

  37. SQL Protocols says:

    1) Were you trying to make local or remote connection?

    2) What does your connection string looks like, please try removing "lpc:" prefix if you specified.

    3) Run *cliconfg* in the command line, check off box "enable shared memory protocol".

    4) Double check whether your SQL 2000 instance started successfully, and listen on shared memory / named pipe/ tcp from server errorlog.

    If you still face problem, please provide your connection string and server errorlog.

    Good Luck!

    Ming.

  38. Matt Neerincx [MSFT] says:

    Additional note, this error message tends to confuse alot of customers with the SQL 2005 part.   The error message can occur when you attempt to connect to ANY version of SQL Server, it does not mean that the driver is trying to connect to some SQL 2005 server.

  39. If you are connection to a local sql server using SqlClient try using Server Name as ‘.’ this worked for me.

    But i am not able to connect to the remote server running sql server 2000. I also tried modifying the HOSTS file still not able to work out. Please drop a mail on my website if someone finds something. thanks.

  40. Varghese Cherian says:

    I had problems connecting to my SQL Server edition that came with Visual Web Developed 2005 Express Edition version. The error was that a remote connection could not established error: 40. I solved it by opening SQL Server Configuration Manager explan SQL Server 2005 Network Configuration clicked on Protocols for SQLEXPRESS to find that Shared Memory was enabled but TCP/IP wasnt and once I enabled it, the connection was established.

    The server is running in the same machine as the development environment.

    One additional thing to note is that you should give <<server or machine name>>SQLEXPRESS as your data source while trying to add a connection

  41. Nam says:

    Hi Ming,

    I get the error:

    [sqsrvres] printODBCError: sqlstate = 08S01; native error = 2746; message = [Microsoft][SQL Native Client]TCP Provider: An existing connection was forcibly closed by the remote host.

    followed by several these other errors

    [sqsrvres] printODBCError: sqlstate = 08S01; native error = 40; message = [Microsoft][SQL Native Client]TCP Provider: The specified network name is no longer available.

    [sqsrvres] printODBCError: sqlstate = 08S01; native error = 40; message = [Microsoft][SQL Native Client]Communication link failure

    [sqsrvres] OnlineThread: QP is not online.

    [sqsrvres] CheckQueryProcessorAlive: sqlexecdirect failed

    and it looked to me like it is potentially related to :  A successful TCP connection from SqlClient to the server was broken due to a TCP keep-alive heartbeat failure (typically indicating problems with the underlying network infrastructure)

    that you mentioned from above i was wondering what type of network problems could be affecting my cluster?  I have disabled Netbios/wins and only have Named Pipes and TCPip on the server…also when i shut down the passive node on my cluster the errors will still pop up… I assume the issue has something to do with the heartbeat on the active machine but thus far have been unable to determine the cause of the error.  Also to note…when i enable netbios/wins the problems happen more frequently  from once a day to multiple times an hour.  Using server 2003 x64 sp1 and sql 2005 sp1 x64

    Thanks

  42. Sonu says:

    I want immediate answer on this. Plz help

  43. Anita says:

    Hi Ming,

    Me too trying to connect to SQlServer 2000

    But am getting the same error.Could u plz tell how to solve it! I tried checking off "enable shared memory protocol".But it didnt worked out

    Thanks in advance

  44. SQL Protocols says:

    Hi,Anita

      Did you get error: "TCP provider: An existing connection was forcibly closed by the remote host"? Did you make remote connection or local connection. To solve this: you need check several things:

    Server side:

    1)Go to services.msc, see whether you sql 2000 was started successfully.

    2) Go to server error log, see whether TCP was enabled and server is listening on <ip>,<port>

    3) netstat -ano | findstr "<port>" double check server was listening on the exact port

    4) If you were making remote connection, double check <port> is in the firewall exception list.

    Client Side:

    5) Try telnet <serverip> <port> see whether it succeeds.

    6) Try change your connection string if you have "tcp:" prefix, remove the prefix,see what happens.

    7) Try change your connection string to " Server = <machinename>[<Instance>],<serverport>/ or Data Source = <machinename>[<Instance>],<serverport>"

    If it is local connection, <machinename> is local hostname, if it is remote connection, <machinename> is remot host name; <port> is the portnumber that server was listening on; <Instance> is the instance name of your sql server, your sql 2000 is default instance or named instance? If default instance, the port should be 1433, if named instance, see the errorlog to check.

    If you have further question:

    1) Please give me what error you saw?

    2) Your connection string?

    3) Client/Server OS?

    4) server errorlog?

    5) local/remote connection?

    Good Luck!

    Ming.

       

  45. SQL Protocols says:

    Hi, Sonu

       Sorry, I did not see the question you posted? Could you give more specific info?

    Thanks!

    Ming.

  46. Thomas says:

    Hi All

    I have been having the same error I have narrowed it down to being the SQL Server Express 2005 not switching on properly.

    These are my issues, everytime i go to the sql server configuration manager and switch on the sql server (sqlexpress) it say

    "The request failed or the server did not respond in timely fashion. Consult the error or other application error log"

    I get a different error when I try and start the SQL server (sqlexpress) in the Sql server 2005 surface interface configuration tool the error is:

    "An error occurred while performing this operation"

    I then get this error when I try and start SQL SERVER (SQLEXPRESS) in the services tool

    "The SQL SERVER (SQLEXPRESS) on your local computer started and then stopped. Some service stop automaticly if they have no work to do, for example, the performance log."

    Now when I try and connected to the sql server Management studio express I get this error

    "An error has occured while establishing a connection to the sql server. When connecting to SQL sever 2005, this failure may be caused by the fact that the default setting sql server does not allow remote connections. (provider, name pipes provider, error: 40 – Could not open a connection to sql server) (microsoft sql server Error: 2)

    Which is the same error I get when I try an use one of my websites which interacts with an sql server 2005 express database.

    So what have I tryed so far to fix this problem, well I have enable TCP/IP and Name pipes in the sql sever configuration manager under SQL server 2005 network configuration / protcols for sql server express

    I have also set up the sql server browser to automatic which is working fine.

    I have setup sql server (slqexpress) to manual and that still switch off like above. There seems to be lots of people out there with this issue.

    WHAT I AM TRYING TO FIND IS A WAY OF STARTING SQL SERVER USING THE COMMAND PROMPT?????

    I need to sort this problem out ASAP.

    Does anyone know how to do this??

  47. Nam says:

    Hi Ming,

    I think Sunu is referring to my post on 6/21/2006 immediately above his. Let me know if you need any more information.  I have found several forums posting similar errors however have not found a solution to it yet :( Let me know if you would like any additional information …also i would like to remove the comment that removing netbios helps…it seems like maybe i just had a lucky streak cause the errors are persisting.  It seems so random. It doesn’t coincide with backups or dbcc commands that we’re running and the machine isn’t being stressed at all….

    plz help

  48. Nam says:

    In response to thomas’ post

    NET START MSSQLSERVER

    NET START SQLSERVERAGENT

    also note that if you start SQLSERVERAGENT that it will automatically attempt to start the dependant service MSSQLSERVER

    Also i see the improper switching to be a result of the errors not a cause… I have found that sometimes when i get this error my cluster service will be unable to communicate with SQLServer (even though it’s on the same machine) and restart the sql service if it can’t connect in a reasonable amount of time.

  49. SQL Protocols says:

    Hi, Thomas

    1)

       By default SQL Express was installed as a named instance, you can find useful info by following the blog:

       http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

    2)From command line, you can use

    net start MSSQL$SQLEXPRESS, since the instance name is fixed for sql express.

    Or you can go to services.msc, find MSSQL$SQLEXPRESS, do start/stop/restart..

    Good Luck!

    Ming.

  50. SQL Protocols says:

    Hi, Nam

       From your description, this looks like not a cluster issue. The error you saw probably is due to server close the connection, could you check server errorlog or system event log see whether there is any useful info to provide clue?

    Also, we need more detail info about your scenario to identify the problem, could you help follow the below guidline and post your answer to the question?

    http://blogs.msdn.com/sql_protocols/archive/2006/04/21/581035.aspx

    Thanks!

    Ming.

  51. Thomas says:

    Hi All

    I fixed the problem I unistalled sql server 2005 express and reinstalled everything is working fine now. Thanks for the advice. Keep up the good work

    regards.

  52. Nam says:

    Thanks ming I checked the system Logs and there are a couple of errors that happen around the same time but they don’t always happen…

    Application popup: Windows – Virtual Memory Minimum Too Low : Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied. For more information, see Help.

    The browser service has failed to retrieve the backup list too many times on transport DeviceNetBT_Tcpip_{2367FB22-08A8-453D-9814-778CBC0FFB4D}. The backup browser is stopping.

    In light of the paging file i have expanded it to the recommended size on from the OS which is quite large.. 48898MB….we have 32Gigs of ram on this server. Let me know if that’s overkill.  I read somewhere that recommended is about equivilant to how much ram you have.

    Hope this works…just in case 😀

    [1] Client side:

      1. What is the connection string in you app or DSN?

    jdbc:inetpool:inetdae7a://serverName?user=User&password=*******&appname=AppProcess&database=DBName

      2. If client fails to connect, what is the client error messages? (please specify)

    Typically only fails to connect during the minute or two when the errors are happening.

    Also if the errors cause a sql server reboot then it will get an error message stating such.

    com.nprise.dao.DaoException: com.inet.tds.s: java.net.ConnectExceptionConnection refused

    com.nprise.dao.DaoException: com.inet.tds.s: Msg 6005, Level 14, State 2, Line 1, Sqlstate 01000

    [DIDATABASE1]SHUTDOWN is in progress.

      3. Is the client remote or local to the SQL server machine? Remote

      4. Can you ping your server? YES

      5. Can you telnet to your SQL Server? YES

      6. What is your client database provider?  merlia java database driver Or/And, what is your client application? SQL Management Studio, Query Analyzer

      7. Is your client computer in the same domain as the Server computer? Same Domain

      8. What protocol the client enabled? TCPIP

      9. Do you have aliases configured that match the server name portion of your connection string? YES

    [2] Server side:

      1. What is the MS SQL version? SQL Server 2005 x64

      2. What is the SKU of MS SQL? Standard

      3. What is the SQL Server Protocol enabled? TCPIP, NamedPipes

      4. Does the server start successfully? YES

      5. If SQL Server is a named instance, is the SQL browser enabled? YES

      6. What is the account that the SQL Server is running under? Domain Administrator

      7. Do you make firewall exception for your SQL server TCP port if you want connect remotely through TCP provider? NA

      8. Do you make firewall exception for SQL Browser UDP port 1434? NA

    [3] Platform:

      1. What is the OS version? Windows 2003 x64

      2. Do you have third party antivirus, anti-spareware software installed? NO

  53. Ritu says:

    Hi,

    I’m getting error msg:(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) while using webparts in my web app.I guess this has something to do with the point that connection string while connecting with aspnetdb in case of web parts uses windows authentication.

    I’m also not able to connect to any other db if i use windows authentication in my connection string.

    Can u plz suggest me any solution for it?

    Thanks

    Regards,

    Ritu

  54. SQL Protocols says:

    Hi, Ritu

       Can you provide the connection string? Please following the below blog and search the error message to see the troubleshoot tips.

    http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

    Good Luck!

    Ming.

  55. SQL Protocols says:

    Hi, Nam

       Thanks for your detail info.

       So,

       First, it is remote connection, how do you telnet? telnet <server> <sqlport>? If your sql instance is a named instance, you should go to server errorlog to check server TCP/IP was enabld and listening on which port;  if your sql instance is default instance, you just try port 1433. Did you try to telnet the correct port? Plus, the <server> must be the hostname of your remote server.

     Secondly, if your sql instance is named instance, did you specify the instance name in your connection string? Normally, you should specify "<remoteserver><instancename>"

     Thirdly, you mentioned you specify the alias, how does it looks like? did you make connection by using alias or use "<servername><insatncename>"? Please double check whether you spcify the correct sql port number in your alias, that might cause client connect to a tcp port that sql instance was not listening on.

    Fourthly, to make remote connection and your remote server has firewall enabled, you need add sql port and browser udp port to the exception list, so, either you add sqlservr.exe and sqlbrowser.exe to exception list or edit the port directly to the exception list. After this done, see whether you can make connection.

    Finally, for a quick workaround is by specifying the port number in your connection string, namely, "<servername><instancename>,<sqlport>", on your server " netstat -ano |findstr <sqlport> " to see server was listening on the port.

    Let me know if you have further question.

    Good Luck!!

    Ming.

     

  56. rape movies says:

    Asaspal. Memrano tu es besta. Amigo.

  57. Nam says:

    Hey Ming,

    default port and default instance also i can telenet into the machine. Not using an alias just the virtual server name that we set up with the cluster.  Also no firewall everything is connecting from in the same domain.  

    The problem isn’t that we can’t connect, we can connect 99% of the time. It’s just that about once a day we lose connection for about 1 minute and get the errors listed above.

    Also since i expanded the page file the problem still persists. :(

  58. Brian says:

    Hi

    I fixed my error 40 by turning off user instances and re editing the connection string in my C# project.

    Hope this helps.

  59. SQL Protocols says:

    Hi, Nam

       One way to identify the 1% connection lose is to open SQL trace file, and see when you got repro, what operation are your client app doing and what was going on on the server…

    Thanks!

    Ming.

  60. rape videos says:

    Your article is quite right, thanks.

  61. jmcnamera says:

    Changing the OSQL command switch from -S to -s -S fixed this issue for me.  Not sure why, but with -S serverinstance we got the can’t find instance error message but with -s it worked.

    Thanks to SqlRick who pointed this out early in the thread.

  62. Kamate says:

    hi ming,

    I am getting the error pasted below when I connect to SQL express with SQL server authentication.

    Can u plz help?

    TITLE: Connect to Server

    ——————————

    Cannot connect to PS0654SQLEXPRESS.

    ——————————

    ADDITIONAL INFORMATION:

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

  63. Kamate says:

    Hi Ming,

    This is further to my previous query,I get the following error when i try to login with sa.

    Login failed for user ‘sa’. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

    Thanks

  64. SQL Protocols says:

    Kamate,

      "Cannot connect to PS0654SQLEXPRESS. .."

    Mostlikely, this is because you are connect to the SQLExpress remotely and the remote protocol is not enable for sqlexpress. Please use SQL Server Surfuce Configuration Tool to enable remote protocol.

      "Login failed for user ‘sa’. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)"

    What is you connection string, you can either use SQL login with UID and Password or use windows integrated authentication, not both. Make sure that SQLExpress authentication mode is "mix" and you have correct SA password is you decide to use SQL login.

  65. Ramesh Babu V says:

    Strange might it sound that, I have this issue with the SQL server connectivity from the .net application. The application seems to connect fine fromthe staging system. but throws up an exception from the development

    Error number  : 18452

    Error : User not associated with the SQL Server trusted connnection..

    Checked for the authentication its configured to mixed as mentioned in the microsoft website.  Is there any other option i am missing here for i am getting this error????

  66. Charlie B says:

    "Login failed for user ‘sa’. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)"

    I have the same problem — how does one specify "mix" for SQLExpress authentication mode? I already allow both remote and local connections  via the Surface Area Configuration — and "Using both TCP/IP and Named Pipes" is set.

  67. masaki says:

    In SQL Server Management Studio, when I tried to connect to the Analysis Services database located on a remote server, it gives me the following error:

    A connection cannot be made.  Endure that the server is running.

    (Microsoft.AnalysisServices.AdomdClient)

    Additional Information:

    — Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. (System)

     — An existing connection was forcibly closed by the remote host (System)

    What should I do?  

    Thanks.

  68. SQL Protocols says:

    Hi, masaki

       The error indicated that

    1) you might have no TCP protocol enabled on remote server, double check SQL configuration manager, see whether remote server was successfully started.

    2) See server error log, check which tcp port server is listening on? Try telnet <remoteserver> <port>, and double check whether the port was added to firewall exception list.

    3) Try osql /S<remoteservername>,<port> /E, see whether it works? If so, open trace file see what operation cause server reset connection, and see eventlog and server errorlog to get clue.

    Good Luck!

    Ming.

  69. SQL Protocols says:

    Hi, marsaki

       I read some discussion about AS issue, so, here I collect helpful troubleshooting tips from those:

    1)Is this AS 2K or AS 2005?

    2)Have you enabled AS to accept remote connections (SAC utility – 2005)?

    3)How do you make connection? You connected through DNS name?

    4)Did you try ping your AS server or ip?

    5)Can you double check the following registry key?

    A. Locate the following key in the registry:

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsa

    B. Does this exist?

    Value name: DisableLoopbackCheck

    Data type: REG_DWORD

    Radix: Decimal

    Value: 1

    Good Luck!

    Ming.

  70. Sergey says:

    OLE DB Provider returns error “General network error (80004005)” – Communication link failure when Job scheduler runs long taking DTS package via TSQL command. DTS package makes UPDATE against big table. This error can issue any time during long taking UPDATE. We have

    Win2k3 sp1 64-bit for IA, SQL 2005 EE 64-bit for IA.

  71. SQL Protocols says:

    Hi, Sergey

       Could you try enlarging query timeout?

  72. Sergey says:

    Thank’s a lot for you answer!

    We increased "general timeout" and "connect timeout. SQL server still drops local connection. We can see in server error log next record:

    Date 21.08.2006 12:39:20

    Log SQL Server (Current – 21.08.2006 12:51:00)

    Source spid60

    Message

    A fatal error occurred while reading the input stream from the network. The session will be terminated.

  73. SQL Protocols says:

    Hi, Sergey

       This is because your client send invalid request and got rejected by server. Could you describe more spcifically what you did?

    1) what is your client provider?

    2) what is your server, sql 2k5 or 2k?

    3) what is your client request?

    You can turn on sql trace to see which client operation caused this failure?

    Also, from error log, you should be able to see the error state, can you provide it?

    Thanks!

  74. M.Seenuvasan says:

    Hi i am new member of this fourm.I am also geting the following problem,Kindly help me to solve the problem

    Problem:

    I am developing one web application with vb.net, we have uploaded our pages in online with the sqlserver version 7. But some pages only showing the following error while view the page.But the online sql server also showing the same version.That we tested. Kindly help to solve the problem and aslo let me know how to post new topic.

    Error:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

  75. SQL Protocols says:

    Hi,

     Please see the following blog to troubleshoot error 40:

     http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

    If you still face problem, please go through our questions w/ connectivity issue:

    http://blogs.msdn.com/sql_protocols/archive/2006/04/21/581035.aspx

    Thanks!

    Ming.

  76. Chandan says:

    Hi,

    I am trying to establish the Database Mirror with Sql server 2005. I am trying to configuring it with witness. I am getting error while clicking on start mirroring button as follows

    "The server network address "%.*ls" can not be reached or does not exist. Check the network address name and reissue the command".

    I am trying to use certificate based authentication. Please advice.

    Regards,

    Chandan

     

  77. DOGAD DOGOUI says:

    j’install actuellement une application et je dois créer une base de donnée à partir d’un script. mais quelle a été ma suprise quand je me suis rendu compte que cette la connexion a SQL 2005 n’arrivait pas à s’etablir: message d’erreur: POUR VOUS CONNECTER A CE SERVEUR VOUS DEVEZ UTILISER SQL Server Management Studio ou SMO. or tenez vous bien j’arrive a me connecter à SQL 2000 avec les même  parametre. bon sang SQL 2005 est très…… HELP ME

  78. SQL Protocols says:

    Pouvez-vous nous donner un exemple de la corde de raccordement que vous employez et le message d’erreur exact avec le nombre exact d’erreur ? Il pourrait être possible que le SQL ne soit pas installé pour écouter sur les raccordements à distance. Si c’est un raccordement à distance vous devrez permettre la connectivité à distance en utilisant le magicien de configuration de superficie.

    Si vous pouvez me montrer le code ou le script où vous essayez de vous relier je peux pouvoir aider.

    C’est un problème avec le SQL ne permettant pas les raccordements à distance ou un problème avec de la votre corde de raccordement. Ceci travaillé avec SQL 2000 ainsi qu’il devrait fonctionner avec 2005 si des raccordements à distance sont permis.

    excuses pour mon Français faible

    Brad Sarsfield

    Microsoft SQL Server

  79. An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)"}

    plz help i think this is very common error when we connect .net(2005) fron 2000 sql server database

  80. SQL Protocols says:

    Hi, Firoz

       Please refer following blog to troubleshooting your problem:

       http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

    Good Luck!

    Ming.

  81. An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

  82. LocoTx says:

    Jinn,

    Error code 53 often indicates that the server is not reachable from the client machine.  If you run the following two commands on the client machine, what do you get (I assume the server is installed as a default intsnace):

    telnet <serverMachineName> 1433

    ping <serverMachineName>

    THIS WAS A LIFE SAVER !!!

    Turns out our DNS was not resolving to the correct IP address.  Although my web.config said "Server=Web4"

    When you pinged it went to the wrong IP.

    DO THIS FIRST !!!

  83. Jeremy says:

    Hi Ming,

    I hope that you can help, having no luck with a 2005 connectivity issue.

    I’ve installed SQL2005 on a server already running SQL2K. SQL2K is the default instance, so I’m trying to connect to SQL2005 using MYSERVERSQL2005 as the instance.

    The steps that I’ve taken are to apply SP1 and enable remote connections (TCP & Named pipes). I’ve also made sure the SQL Server Browser service is running and enabled.

    The error message that I get via SQL2005 client tools is "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)"

    I can connect to Analysis Services, using SERVERNAMESQL2005, if that helps.

    I dont see anything stange in the error logs, looking under Management->SQL Server Logs.

    Do you have any ideas?

    Many thanks

    Jeremy

  84. ratheesh says:

    How  to correct sql server 2005 Error No :40

  85. Denis says:

    Hi,

    I am unable to connect to my SQL Server Express engine with the SQL Server Management Studio Express, although it works with ODBC. I am working on the very same server.

    When I connect with WinSQL using ODBC, everything is fine. When I try connecting with Mgmt Studio Express, I get the typical Named Pipes Provider, error 40: … SQL Server, error 53.

    This used to work before. I installed a TV tuner and got a MS Video network adapter (whatever it might be). It is disabled now and pinging (it’s localhost anyway) works. Telnet shows no reaction.

    I have a netstat showing the SQL server listening on 0.0.0.0:1433. The firewall log does not show any connect attempt (it is still localhost).

    The only thing I haven’t tried yet is connecting from another computer. Since ODBC does work, my guess is that the Mgmt Studio is giving the trouble, since the service is working.

    Any hint?

    Thanks,

  86. Linkin says:

    Please somebody help me,i install sql server 2005 in local machine but no servers name are avaible to me,and when i try to connect to (local),the error shows to me:

    TITLE: Connect to Database Engine

    ——————————

    Cannot connect to sqlserver2005.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    Please someone help me,in configuration manager i dont see any instances….whats wrong?!?!

  87. twentzler says:

    I need help with this error.

    A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.)

    I went to Ming’s links and did not find help there so I came back here.  I read this error is typically indicating problems with the underlying network infrastructure… OK.  How ever this is SQL express standing alone on a laptop.  I have one dB one SQL  one laptop no network involved. Since it has been working fine for 19 months I am thinking system resources of some kind. Performance, memory, size of dB something like that.  I have ompletely re-installed everything from the OS on up. I do not really know where to go from here.

    Any help would be appreciated.

    Tracy

  88. rajiv says:

    Error: the request failed or the service did not respod in a timely fashion. Consult the event log or other applicable or other applicable error logs for details.

  89. vin says:

    Cannot connect to PNES014SQLEXPRESS.

    ——————————

    ADDITIONAL INFORMATION:

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

  90. Pradyuman says:

    TITLE: Connect to Server

    ——————————

    Cannot connect to mssql8.3essentials.com.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

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

    ——————————

    BUTTONS:

    OK

    ——————————

  91. SQL Protocols says:

    Hi, vin

       The error you saw either because the reason described in the following blog:

    http://blogs.msdn.com/sql_protocols/archive/2006/07/26/678596.aspx

    Or because of under high CPU consumption.

    Good Luck!

    Ming.

  92. Rohit says:

    One thing that I tried to do when I got this error message "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)"

    is increase the timeout duration to 60 instead of 15 seconds. It worked in my case, and I was able to connect to some other SQL Server DB.

  93. Jeronimo says:

    Hi,

    I tried to use SQLCMD to run a sql script. But unfortunately I get the folowing message when I press enter after SQLCMD in a DOS box.

    Named Pipes Provider: Could not open a connection to SQL Server [2].

    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..

    Sqlcmd: Error: Microsoft SQL Native Client :

    Login timeout expired.

    This is on a server running SQL 2005 Express.

  94. Joel says:

    I am trying to insert a 450 meg file into a table across a linked server and the insert fails. I am getting the following error message:

    A fatal error occurred while reading the input stream from the network. The session will be terminated.

    The insert works fine on files under 250 megs. Also, the file can be inserted when done locally. But across the network on a linked server, it fails. Any ideas?

  95. Peter says:

    Jeronimo,

    Error code 2 usually means one of two things:

    (1) The target server does not have Named Pipes enabled.  

    (2) The server name specified is incorrect.  

    What is the exact SQLCMD command you use (replace any confidential information)?  

    Answer to the checklist from http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=362498&SiteID=1 may help as well.  

  96. Peter says:

    Joel,

    What client driver/provider you use (MDAC ODBC, OLEDB, SQL Native Client, managed SqlClient, JDBC, …)?  

    Can this be a time-out error retrieving the data?  

  97. SStark says:

    I installed SQL Server 2005 Express on a Windows 2000 platform and, without changing any of the defaults, the SQL Server Management Studio functioned properly.  However, after uninstalling and re-installing SQL Server 2005 Express, I keep getting the infamous "(provider: TCP Provider; error: 0 – No connection could be made because the target machine actively refused it.)(Microsoft SQL Server, Error: 10061)"

    From reading the various comments presented here, I assumed that the problem was because the default settings disable TCP and named pipe connections.  I used the SQL Server Surface Area Configuration tool and enabled all of the access methods (TCP and Named Pipes) for both local and remote connections.  The results were the same.

    I checked the log file and it shows the following:

    Server is listening on [ ‘any’ <ipv4> 1457].

    2007-01-17 09:26:21.85 Server      Server local connection provider is ready to accept connection on [ \.pipeSQLLocalSQLEXPRESS ].

    2007-01-17 09:26:21.85 Server      Server named pipe provider is ready to accept connection on [ \.pipeMSSQL$SQLEXPRESSsqlquery ].

    What I really don’t understand is why the Server Management Studio tool is attempting to connect using TCP instead of shared memory.

    I would appreciate any suggestions as to where I go from here.  

  98. SStark says:

    I installed SQL Server 2005 Express on a Windows 2000 platform and, without changing any of the defaults, the SQL Server Management Studio functioned properly.  However, after uninstalling and re-installing SQL Server 2005 Express, when I try to connect to the SQL Server, I get an error; "(provider: TCP Provider; error: 0 – No connection could be made because the target machine actively refused it.)(Microsoft SQL Server, Error: 10061)"

    From reading the various comments presented here, I assumed that the problem was because the default configuration settings of the SQL Server disable the TCP and Named Pipe network protocols for remote connections.  I used the SQL Server Surface Area Configuration tool and enabled the access methods (TCP and Named Pipes) for both local and remote connections.  The results were the same i.e. no connection to the SQL Server could be made and the error 10061 message was displayed.

    Using the Server Configuration Manager tool, I changed the default protocol for the server aliases to Named Pipe from TCP.

    I stopped and started the SqlServer.  I then  started the SQL Server Management Studio tool and tried to connect to the database engine.  I specified the Named Pipe as the Network Protocol in the Options tab of the Connection dialog box.

    This time, I observed a different error "(provider: Named Pipes Provider; error: 40 – Could not open a connection to SQL Server.)(Microsoft SQL Server, Error: 2).  

    I checked the log file and it shows the following:

    Server is listening on [ ‘any’ <ipv4> 1457].

    2007-01-17 09:26:21.85 Server      Server local connection provider is ready to accept connection on [ \.pipeSQLLocalSQLEXPRESS ].

    2007-01-17 09:26:21.85 Server      Server named pipe provider is ready to accept connection on [ \.pipeMSSQL$SQLEXPRESSsqlquery ].

    It appears as though the settings in the Server Configuration Manager for the Client protocols (allowing remote access) are not affecting the SQL Server.

    This is getting a little weird.  

  99. SStark says:

    While troubleshooting problems with connecting to the SQL Server Database Engine, I discovered the following error reported during installation in the SQLSetup[xxxx]_[ComputerName]_Core.log file:

    Running: OpenPipeAction at: 2007/0/16 18:43:0

    Complete: OpenPipeAction at: 2007/0/16 18:43:0, returned false

    Error: Action "OpenPipeAction" failed during execution.

    Running: CreatePipeAction at: 2007/0/16 18:43:0

    Complete: CreatePipeAction at: 2007/0/16 18:43:0, returned false

    Error: Action "CreatePipeAction" failed during execution.

    Action "RunRemoteSetupAction" will be skipped due to the following restrictions:

    Condition "Action: CreatePipeAction has finished and passed." returned false.

    I can’t find any explanation of what would cause the CreatePipeAction to fail.

    Any assistance would be appreciated.

  100. SQL Protocols says:

    Hi, SStark

       Thanks for the detail info.

       From the error message that you tried NP connection, seems your sql server not start or you connect to a wrong instance.

       1) Were you making remote connection? If so, did you make "File and printer sharing" and tcp port:1457 in Firewall exception list on the servre box?

       2) can you try telnet <ipofserver> 1457, succeeded?

       3) can you try "osql /S\<servername>pipeSQLLocalSQLEXPRESS /E", if local connection, <servername>="."; else, put real machinename.

       4)In your connection string, did you specify the instance name? like make connection use osql /S.sqlexpress /E for local conn.

    osql /S<machinename>sqlexpress /E

       5)But as you mentioned setup issue, please first double check status of the running instance"

    sc query mssql$sqlexpress".

    Also, check out the following blog for making connection to sqlexpress.

    http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

    Good Luck!

    Ming.

  101. Joel says:

    The linked server is using provider SQL Native Client, SQLNCLI, with allow inprocess checked.  Also I was able to manually move a file(over 250 mb) by directly logging on to the box and mapping a drive to the other boxe (rules out a network restriction).  Finally both servers are set with allow remote access, and the connection timeouts are maxed.

  102. Joel says:

    Heard from Microsoft today, Linked servers have a size maximum of 255MB. Meaning you can pass data (in a variable) larger than 255MB over a linked server.

  103. Joel says:

    Sorry Typo

    Meaning you cant pass data (in a variable) larger than 255MB over a linked server.

  104. R Klio says:

    Hi everyone,

    I’ve got problem querying remote tables via a specific linked server.

    The server from which I execute the query is an SQLServer2005 and the linked server is an SQLServer2000.

    If I do select * from <linked server>.<database name>.<db owner>.<Table1>  after a while I get the following error message

    "Server: Msg 10054, Level 16, State 1, Line 0, TCP Provider: An existing connection was forcibly closed by the remote host."

    I execute the query using profiler and I got the following profiler error: ‘OLE DB provider "Unknown" for linked server "(null)" supported the schema lock interface, but returned "0x80040e96" for "ReleaseSchemaLock".’ (The query returns a subset of records before it is forcibly stopped)

    The strange thing is that i used to run the same query a week or two ago and faced no problem.

    Please help.

  105. Shum says:

    Hey guys!!!

    Please help me with this, when i try to import a database made in access to sql server 2005 i get the following error….

    TITLE: SQL Server Import and Export Wizard

    —————————————-

    The SSIS Data Flow Task could not be created. Verify that DTSPipeline.dll is available and registered. The wizard cannot continue and it will terminate.

    —————————————-

    ADDITIONAL INFORMATION:

    Value does not fall within the expected range. (Microsoft.SqlServer.DTSRuntimeWrap)

    —————————————-

    BUTTONS:

    OK

    —————————————-

    It worked fine, but i had to uninstal SQL and when i installed again i came across this problem….

  106. Shum says:

    plz plzzzz… do resolve this issueee .. ive two months for the project and im stuck with this thing for the last 2 weeks at initial stage.

  107. Matt Neerincx (MSFT) says:

    I would post this to the sql server SSIS newsgroup, they would be more helpful here ->

    http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1

  108. Minaz Amin says:

    We have setup remote peer to peer replication SQL Server 2005 SP2.

    I have already enabled the

    1. TCP/ IP in both the Server

    2. Browser Service is running

    3. Remote connection is enabled

    4. Added the Server name in the HOST file.

    5. Can ping / Telnet both the server.

    6. Added the DWORD in the resgistry as setup readme for windows 2003 SP1 connection issue.

    Still I have facing the same issue and not able to replicate the database.

    Plaese give me a solution. This is an urgent issue.

    Regards,

    Minaz Amin

  109. Kevin O says:

    I’ve installed Vista on my laptop and I installed SQL Server 2005. I’m connected to a VPN at the University I attend. I’m trying to connect to the universities server at the SQL Server connection page and I get the following error:

    Login failed for user ”. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider).

    Any ideas on this?

    Thanks,

    Kevin

  110. DarkNite says:

    Hi Nam and or Ming (or anyone),

    Did you ever figure out Nam’s problem?  I’m also getting sporadic connection errors.  They seem to happen most often when the workload is a little heavier, but I’d be shocked if it’s a worker thread issue.

    We get the errors from SQL Agent jobs, remote Java batch jobs, and from a third party replication tool (Data Mirror).

    Thanks, Bill

  111. Kelli says:

    I get the following error:

    Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2

    I have set up remote connections and have set up Windows Firewall exceptions  (per knowledgebase).  I’ve also named the TCP_All port 1433, and set the server for mixed authentication but the server won’t connect. (It did when it was Windows Authentication only, but now it won’t connect for me to change it back.) I’m trying to use with Cognos8 on my laptop.  The SQL browser connects fine, and the SQL Reporting Services connects fine, but the server itself obstinately refuses.  I could really use some help.

    Thanks, Kelli

  112. Matt Neerincx (MSFT) says:

    Go to the server cmd prompt and run:

      netstat -aon | findstr 1433

    Ensure that SQL Server is listening on 1433.  You should see something like:

    TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING 1234

    Where 1234 is process ID of SQL Server.

    Then on server run:

       telnet localhost 1433

    If this connects, press Ctrl+] then type quit to exit telnet.

    Now do the same telnet remotely, if this fails then your port is still blocked.  If it works, then you should be able to connect.

  113. melroxanne says:

    so i hear all this talk about changing the default to allow remote servers but

    HOW ON EARTH DO YOU DO IT!!!!!!!!!!!!!I can’t connect to my server at school and it’s an online class.   PLEASE HELP

  114. Matt Neerincx (MSFT) says:

    If you have SQL Server installed you should see an icon called SQL Server Surface Area Configuration.  If you don’t see the icon look under ->

    C:Program FilesMicrosoft SQL Server90SharedSAC.EXE

    Run this executable to launch the program, then click on the link "Surface Area Configuration for Services and Connections".  Drill down the tree under your instance name (MSSQLSERVER is the default instance) then

    Database Engine then Remote Connections and select the options you want here and press OK.

  115. ... says:

    Du musst ein Fachmann sein – wirklich guter Aufstellungsort, den du hast!

  116. DarkNite says:

    For those of you having the intermittent connection problems, this link may be helpful:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=620912&SiteID=1.

    So far, giving the SQL Server service accounts the Windows permission to lock pages in memory has stopped our problems.  Even domain accounts with admin rights don’t have this permission by default.

    Of course, rebooting the nodes in our cluster may also be the reason we haven’t seen any connection errors today.

  117. mary says:

    hiiiiiiiii,

        when i am connecting the sqlserver in windows application , it not given any error. but when i am connecting the sqlserver in windows application, it given the error, "An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)".

    plz help me to solve the problem.

    Thanks

    regards

    MMary

  118. StuBeDo says:

    Hi

    I have the error:

    "TITLE: Connect to Server

    ——————————

    Cannot connect to "SQL Server Name".

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    ——————————

    BUTTONS:

    OK

    ——————————

    "

    I can ping to the machine name and ip ok. Remote connections are allowed on the SQL server instance. I can login locally to the SQL server.

    sqlcmd -S "sqlservername" -E gives the following error

    HResult 0x35, Level 16, State 1….

    Any ideas how to reslove this

  119. muhammad fahad masud says:

    TITLE: Connect to Server

    ——————————

    Cannot connect to FAHADMASOOD.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    i am recieving this error however i m not connected to any network i m running sql server 2005 on my pc and recieving this error plz kindly tell me how can i resolve this error

  120. vinay says:

    After restoring the Database using SMO (from code), when I try to execute any sql statement on the restored DB, I get the following error :

    A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.)

    Could you please help me out on this ???

  121. Matt Neerincx (MSFT) says:

    First thing I would do is check the SQL Server ERRORLOG.  This could be a sign of a corrupted database, try connecting to the server and running dbcc checkdb on the database.

  122. shari says:

    Connection::Open failed 0x80004005

    We are running a POS application on SQL 2005 and are unable to open the application database.  The error we are getting is above.

    URGENT help

  123. I have windows vista, sql server 2005 express, vb express and there is not chance to connect to a database from the database explorer. I have not problem to connect from Management Studio, but whenever i wanted open a connection arise a message telling me that there is need to ask permission to owner or administrator, i have windows authentication and i am the only user (the administrator).

  124. Matt Neerincx (MSFT) says:

    Could you post back with the exact error message?

  125. Sergeir says:

    Error in SSIS:

    Error: 0xC0202009 at QR_OrderItem Insert, UPDATE QR_OrderItem [440]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.

    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Login timeout expired".

    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".

    An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "TCP Provider: Only one usage of each socket address (protocol/network address/port) is normally permitted.

  126. Chakravarthy says:

    I have created a linked server and but when i am trting fetch some data, it is returning the following error message.

    could u please help me on this?

    OLE DB provider "SQLNCLI" for linked server "ReportProd" returned message "Unable to complete login process due to delay in opening server connection".

    OLE DB provider "SQLNCLI" for linked server "ReportProd" returned message "Invalid connection string attribute".

    Msg 7303, Level 16, State 1, Line 1

    Cannot initialize the data source object of OLE DB provider "SQLNCLI" for linked server "ReportProd".

  127. Vipin says:

    Hi,

    I have enabled all the TCP/IP services and also added the sqlserver.exe and sqlbrowser.exe to the firewall and restarted the SQL server. But i am still unable to connect with the remote database.

    It is still showing error;

    provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    I am using SQL server 2005 Express with Windows XP.

    Please help me out with this problem.

  128. Jim Browsant says:

    That worked. Thank you

    # re: SQL Server 2005 connectivity error messages

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

    to correct this error in SQLEXPRESS on servername use [servername]sqlexpress, this should work

    Monday, February 13, 2006 2:04 PM by Vitgar

  129. Lucky says:

    remove the Port numbers specified in the connection string.

  130. Fred says:

    Current, I have this problem:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061)

    After I installed SQL 2005 Express in Server 2003, I made firewall and SQL server setting and it works well without any problem from remote site. However, next day morning, when I try to connect it, it gives above error.

    Current I can connect SQL server in local computer. I can connect web server from remote site without any problems. And I also can use remote desktop access.

    Any helps is welcomed.

  131. MANISH says:

    I am calling extened stored procedure through stored proc in sql 2005. In one machine it works properly where as in another machine it gives an error saying that "Msg 233, Level 20, State 0, Line 0

    A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.)"

    Environment:

    Windows 2003 image with Sql 2005 in VMWare Workstation.

    Do we required any specific credential to run extended strored proc in sql 2005 or is it a problem bcoz of some sql setup.

    please do the needful.

    Note: The same extended stored proc is working fine in sql 2000.

    Thanks,

    Manish Jha

  132. Prabal says:

    I’m having a big problem with a SQL 2K5 cluster (using standard edition, SP1). I can get onto the box and connect to the sql server locally fine. However when I try to connect remotely I get errors. I’ve read all the above advice and my problem is that I definitely have got remote connections enabled, and sql browser running, and our NT/networking people are positive that there are no firewalls etc involved. I’ve also tried hardcoding the IP address in the client network utility entry, just using <ip address>, port number as well as trying hostnameinstance name, port number. The other odd thing is that the remote connectivity was originally working fine but just seemed to stop working the next day! I’ve built several non-cluster sql server 2005’s and never had this problem with them.

    Let’s call the two sides of the cluster, CL1 and CL2 and the "virtual server" is CL3. Locally I can connect without any problem at all to the SQL server, but I just can’t connect to it from any remote machine.

    The server in question is instance name LMS_PRD running on CL3, port 10051. TCP/IP is definitely enabled for local and remote connections (I have checked this in the SQL server surface area configuration). I can connect locally without any problem. Also, locally, if I do,

    telnet CL3 10051

    it connects fine

    From a SQL 2000 box – when I try to connect from sql query analyzer, I get

    "Unable to connect to server LMS_PRD Server Msg 17 … SQL server does not exist or access denied"

    Client network utility shows server alias – LMS_PRD, TCP/IP, CL3LMS_PRD,10051

    [I can connect to other SQL 2005 servers OK from this same server using this same method]

    On this box, when I do telnet CL3 10051 , I get "Connecting to CL3…Could not open a connection to host on port 10051 : Connect failed". (Same thing if I use the IP address).

    [When I do a similar one for another SQL 2005 box, "telnet U01 10051", it connects fine]

    From another SQL 2005 box – when I try to register the server, I get

    "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP provider, error 0 – No connection could be made because thew target machine actively refused it.) (Microsoft SQL Server, Error: 10061)"

    IN the SQL native client configuration it shows alias name – CL3LMS_PRD, server=CL3LMS_PRD, protocol tcp, parameters 10051

    Again if I do telnet CL3 10051, I get the error above.

    From this same box I can register another SQL 2005 server without any problem and do the telnet to it OK

    Just to emphasise:

    (a) The SQL server configuration manager shows that TCP/IP is enabled, and that 10051 is the port (in IPALL, TCP port). Also I have checked the SQL server errorlog – it is definitely using 10051 as the port.

    (b) The SQL server surface area configuration shows under local and remote connections using both TCP/IP and named pipes selected (I’ve tried both this and the using tcp/ip only option)

    (c) SQL server browser is running

    (d) There are NO firewalls etc involved

    Any help or advice MUCH appreciated

  133. Prabal says:

    Finally got to the bottom of this. It suddenly occurred to me that I hadn’t looked in the event log, so I had a look and lo and behold: there was an error that suggested that the virtual server’s IP address was not unique on the network! Looks like some sort of solaris machine was using the same IP address. I’ve changed it (impressed how easy it was – just a setting from the cluster administrator) and now all connectivity issues are gone.

    I suppose the moral of the story is always to check the system logs first!

  134. Matthew Corneliu says:

    TITLE: Connect to Server

    ——————————

    Cannot connect to LITTLEANGLESQLEXPRESS.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)

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

    ——————————

    BUTTONS:

    OK

    ——————————

    Hi. I’m not sure if that message waslisted or not. I keep getting this message and im not sure if im the only one.Th eprogram worked fine for about 2-3 days an this message just started poping i stop connecting.If possible help would be highly apprecited.

  135. SQL Protocols says:

    This message is discussed previously in this forum. Here are the suggestions:

    Check whether

    (1) The SQL Browser service is running on the server box.  

    and/or

    (2) The SQL Browser’s UDP port 1434 is blocked by firewall.  You can grant exception either to UDP port 1434 or to SQL Browser process.  

    If you are trying to remote connection to Sql Server 2005, you need to enable your TCP/IP Protocol in your SQL Server Configuration Manager.

    SQL Server Configuration Manager

    -> SQl Server 2005 Network Configuration

     -> Protocols for <instance>

    After enabling the TCP/IP, you need to restart the SQL Server for the changes to take effect.

    If these suggestions don’t help, please provide more information about how you are trying to connect to SQL Server Express (local or remote connection, connection string, OS on client and server machines). Please also provide the most recent SQL Server ERRORLOG (from installed dirLOG, e.g. Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOG). I will be able to provide additional help once I know these details.

    Thank you

    Stoyko Kostov

  136. vaibhav says:

    login failed for user ‘sa’ the user is not associated with trusted sql srver connedction: mssql error 18452

  137. Ryan Soe says:

    An error has occured while establishing a connection to the server.When connecting to SQL Server 2005

    this failure may be caused by the fact that under the default setting SQL Server does not allow remote

    connections.(provide:Named Pipes Provider,error:40-Could not open a connection to SQL Server)(Microsoft SQL Server,Error:1326)

    I got this error when I connect to my SQL server from sql server client express edition which is run on Vista , Help me urgently

  138. zdena says:

    Hi guys, I have a problem with error: 40.

    I made a Web page, and it works perfect on my local machine, everything is OK, until I uloaded page to the server, it reports this error:

    ON MY LOCAL MACHINE EVERYTHING WORKS AS IT SHOLULD, BUT ONLINE WONT, PLEASE HELP

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

    Stack Trace:

    [SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)]

      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735091

      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

      System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820

      System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628

      System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

      System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359

      System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28

      System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

      System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

      System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

      System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

      System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

      System.Data.SqlClient.SqlConnection.Open() +111

      System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83

      System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770

      System.Web.UI.WebControls.Repeater.GetData() +50

      System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +232

      System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +53

      System.Web.UI.WebControls.Repeater.DataBind() +72

      System.Web.UI.WebControls.Repeater.EnsureDataBound() +55

      System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +12

      System.Web.UI.Control.PreRenderRecursiveInternal() +77

      System.Web.UI.Control.PreRenderRecursiveInternal() +161

      System.Web.UI.Control.PreRenderRecursiveInternal() +161

      System.Web.UI.Control.PreRenderRecursiveInternal() +161

      System.Web.UI.Control.PreRenderRecursiveInternal() +161

      System.Web.UI.Control.PreRenderRecursiveInternal() +161

      System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

    I dont’t Know what to do. Please HELP!

    ——————————————————————————–

    Zdena

  139. Andrew says:

    Hi guys,

    I have a wierd one i’m afraid and can’t seem to figure it out.

    I am using 3 computers

    1 – my own, from home – uses Vista ultimate and sql 2005 developer edition

    2 – server at work, windows 2003 server R2 with sql 2005

    3 remote server on windows 2003 and again sql 2005. i don’t have physical access to this one. it’s in a different country.

    nr 1 and 2 are fine , can log in to each other , no problem whatsoever.

    however when i try to connect from 3 to 1 or 2 it does not work. i always get this :

    Error Number: 53

    Severity: 20

    State: 0

    if i telnet using telnet ip 1433, it does not work. i get destination unreachable.

    However if i ping them it works for both 1 and 2.

    all computers are properly set up for remote connections with tcp ip and named pipes on. I am always using sa to login on all of them. I am trying to export data from server 3 which is a live server to 2 which is a development server.

    I am afraid i have no idea what to try next. any clues ?

  140. Hi all,

    Please help me any one to resolve this error

    as soon as possible post the solution for this perticular problem .

    ————————————————————–

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)]

      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123

      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

      System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +685966

      System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +109

      System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383

      System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

      System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

      System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359

      System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28

      System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

      System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

      System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

      System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

      System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

      System.Data.SqlClient.SqlConnection.Open() +111

      System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86

      Operation.ShowMainCategory() +99

      _Default.GetMainCategory() +69

      _Default.Page_Load(Object sender, EventArgs e) +21

      System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15

      System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34

      System.Web.UI.Control.OnLoad(EventArgs e) +99

      System.Web.UI.Control.LoadRecursive() +47

      System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

    ——————————————————–

    Thanking you ,

    shubahm saurabh

    shubahmsaurabh@gmail.com

  141. Hi all,

    Please help me any one to resolve this error

    as soon as possible post the solution for this perticular problem .

    ————————————————————–

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)]

      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123

      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

      System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +685966

      System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +109

      System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383

      System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

      System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

      System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359

      System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28

      System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

      System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

      System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

      System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

      System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105

      System.Data.SqlClient.SqlConnection.Open() +111

      System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137

      System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +86

      Operation.ShowMainCategory() +99

      _Default.GetMainCategory() +69

      _Default.Page_Load(Object sender, EventArgs e) +21

      System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15

      System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34

      System.Web.UI.Control.OnLoad(EventArgs e) +99

      System.Web.UI.Control.LoadRecursive() +47

      System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

    ——————————————————–

    Thanking you ,

    shubahm saurabh

    shubahmsaurabh@gmail.com

  142. arun says:

    Could not locate registry entry for OLE DB provider ‘Microsoft.SqlServer’.

  143. iwntstarbucks says:

    Seeing how 1and1 doesn’t offer remote connection to there SQL2005 is there a string that I can put in my web.config file to get around that?

  144. Sanjay Kala says:

    GO to – Sql server 2005 -> configuration tools ->Sql server 2005 surface area configuration -> click on surface area configuration service and connection -> click on remote connection and set Local and remote connection to – Both TCP/IP and Named Pipe.

    This setting is the solution for error 28 connection issue

  145. BillyZ says:

    I want to connect my web application which is on a server on one domain to my sql server 2005 database which is on another server on a different domain.  the SQL Server is set to accept remote connections Both TCP/IP and Named Pipe.

    I have tried several connection strings and keep getting error:40-Could not open a connection to SQL Server. here is the string which I believe should work but still gives the error: Data Source=servername.domain.orgsqlServerName;Initial Catalog=databaseName;Persist Security Info=True;User ID=username;Password=userpass

    Is there something wrong with the format of this string?

  146. Justin says:

    I’m trying to set up DotNetNuke with SQL Server 2005 and UltiDev CassiniASP.Net Server, but I keep getting That error 26. I have modified my web.config, added UDP port 1434 to the exceptions list on my firewall, and made sure TCP/IP was enabled. Send me an email if you can help me out…  justin057@cox.net

  147. Manav Sinha says:

    The following error occurs while creating a linked server from sql server2005 ..

    An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.sqlserver.connectioninfo)

    Named Pipes provider :Could not open a connection to SQL Server[53].

    OLE DB provider "SQLNCLI" for linked server <Linked Server Name> returned message "An error has occurred while establisheing a commention to the server. When connecting to SQL Server 2005,this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections".(Microsoft SQL Server,Error:53)

  148. Manav Sinha says:

    The following error occurs while creating a linked server from sql server2005 ..

    An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.sqlserver.connectioninfo)

    Named Pipes provider :Could not open a connection to SQL Server[53].

    OLE DB provider "SQLNCLI" for linked server <Linked Server Name> returned message "An error has occurred while establisheing a commention to the server. When connecting to SQL Server 2005,this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections".(Microsoft SQL Server,Error:53)

  149. BOBO Sinha says:

    The following error occurs while creating a linked server from sql server2005 ..

    An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.sqlserver.connectioninfo)

    Named Pipes provider :Could not open a connection to SQL Server[53].

    OLE DB provider "SQLNCLI" for linked server <Linked Server Name> returned message "An error has occurred while establisheing a commention to the server. When connecting to SQL Server 2005,this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections".(Microsoft SQL Server,Error:53)

    Please send me the solution on bobosinha@yahoo.co.in

  150. Khushi says:

    HI,

    I am facing following problem :

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

    I am unable to find Protocol for instance in configuration manager and it is also enable in client network.  

    Plzzzzzzzzzzz help, its urgent !!!!!!!!!

  151. SQL Protocols says:

    Start->Run  "SQLServerManager.msc"

    Under  +SQL Server 2005 Network Configuration

                Protocols for INSTANCENAME

                    Enable Named Pipes or TCP/IP

    then restart the SQL Service

      net stop mssqlserver

      net start mssqlserver

    If it’s a named instance (not default) start SQLBrowser

    net start sqlbrowser

    Brad Sarsfield

  152. khushi says:

    Thanx Sir but the problem is that there is no item shown under SQL Server 2005 Network Configuration, no protocol.

    Plz help me!!!!!!!!11111

  153. Andy says:

    Hi

    I am facing the same error with PeopleSoft application with SQL 2005 database.

    The exact error message that I receive is

    "[Microsoft][SQL Native Client]TCP Provider: An existing connection was forcibly closed by the remote host.

    Failed SQL stmt:UPDATE PS_AX_SETUP_WRKPLC SET COUNTER = COUNTER + 1 "

    The strange thing is that I got the same error message for some other processes and the common thing was increamenting the counter as I am doing in the statement above.

    Has anyone faced similar problem before?

    Thank You In Advance

    Andy.

  154. Khushi says:

    HI,

    I have installed SQL SERVER 2005 ENT edition and I am facing following problem :

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

    I am unable to find Protocol for instance in configuration manager and it is also enable in client network.  

    Plzzzzzzzzzzz help, its urgent !!!!!!!!!

  155. Ananda says:

    I have been experiencing the error message listed above:

    A successful TCP connection from SqlClient to the server was broken due to a TCP keep-alive heartbeat failure (typically indicating problems with the underlying network infrastructure) (error: 0):

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The specified network name is no longer available.)

    Possibly:

    A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 – An existing connection was forcibly closed by the remote host.)

    In this Microsoft forum:

    http://forums.microsoft.com/msdn/showpost.aspx?postid=134053&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=3

    A developer suggests clearing the connection pool associated with the current connection,  and or retrying the connection when the (forcibly closed) connection is discovered.  

    In the same forum thread above, notice the similar but different error message caused by SQL Server’s defenses against DOS attacks (Error: 10054):

    ProviderNum: 7, Error: 10054, ErrorMessage: "TCP Provider: An existing connection was forcibly closed by the remote host

  156. ken says:

    Hi All,

    Please help me out in solving the following error

    Query Engine Error:’01000:[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.’

  157. teo says:

    Hi

    I encounterd a rare error,that was ‘provider: HTTP Provider, error: 0 – ‘ with managed SqlClient.

    Of course,I did not make a HTTP end point.

    This error occured when SQL Server was doing heavy batch process.

    SqlClient might have tried to connect the (local)instance with shared memory protocol,but failed.

    In past,Koterpillar posted about this HTTP provider error,and I entirely agree with him.

  158. tshepang says:

    could not connect to server windows socket error. no connection could be made because the target machine actively refused it.

  159. ermias says:

    please give some idea about this kind of problems Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)"

  160. Ananda says:

    See my post in this forum for the solution and the underlying problem we discovered on our server:

    http://forums.microsoft.com/msdn/showpost.aspx?postid=2879238&siteid=1&mode=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=4

  161. SANDEEP BHARARA says:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 – No connection could be made because the target machine actively refused it.) (Microsoft SQL Server, Error: 10061

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

  162. SQL Protocols says:

    Your error message contains an OS error 2. Please check this blog about what it means. http://blogs.msdn.com/sql_protocols/archive/2007/05/16/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error-xxx.aspx

    Basically, this means that NP is not enabled on your SQL Server. Please make sure it’s enabled.

    Thanks. Xinwei  

  163. Ah says:

    Dear Sir

    i have this massege during my connection to SQL Server 2005

    "

    Login failed for user ”. The user is not associated with a trusted SQL Server connection"

    i dont know why?

    i ahve windows authenitication Mode for user connected to the Database.

  164. SQL Protocols says:

    Ah: Right now I assume you have Windows Authentication enabled. Try instead changing that to Mixed Mode.

    http://support.microsoft.com/kb/555332

    If that doesn’t work, you can try instead taking a look at your connection string (look at the blog post). Be very careful about your spaces and semi-colons. Play around with it a little and see if that won’t get it to work.

    HTH – Tres London

  165. Simon Reilly says:

    Anyone offer any advice on some strange behaviour we’re seeing?

    We’re getting different behaviour connecting to SQL2005 under .net v1.1 and .net 2

    From the SQL error logs

    2008-04-02 15:21:00.07 Logon       Error: 18456, Severity: 14, State: 5.

    2008-04-02 15:21:00.07 Logon       Login failed for user ‘simsinit’. [CLIENT: 10.128.1.123]

    2008-04-02 15:21:23.42 Logon       Error: 18456, Severity: 14, State: 5.

    2008-04-02 15:21:23.42 Logon       Login failed for user ‘simsinit’. [CLIENT: <local machine>]

    When run under a version 1.1 application the IP is used, when run under v2.0 <local machine> is being used and this is causing our application to fail..??

    In both instances the connection string is using machinenameinstancename , so why is it reporting differently in the logs?

  166. Sean says:

    We have ahd a lot of problems with transport errors in a new SQL Server 2005, ASP.NET 2.0 installation on HP hardware and this was our solution

    http://support.microsoft.com/kb/942861

  167. Tom says:

    Hello,

    We are getting this error when using SQL Management Studio and .NET:

    A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 – The specified network name is no longer available.)

    Thanks for any ideas how to fix it.

    Tom

  168. Steve Elkins says:

    I received this version of this error message:

    Product: SQL Server

    ID:        53

    Source:        MSSQLServer

    Version: 9.0

    Component: SQLEngine

    Message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (.Net SqlClient Data Provider)

    Explanation

    The SQL Server client cannot connect to the server. This error could occur because either the client cannot resolve the name of the server or the name of the server is incorrect.

    User Action

    Make sure that you have entered the correct server name on the client, and that you can resolve the name of the server from the client. To check TCP/IP name resolution, you can use the ping command in the Windows operating system.

    Just for yucks, I replaced the server name with "localhost" and, presto, the connection fired right up! It would appear that the SQL Server Client thinks that its looking for a remote server even when it isn’t (I’m working with both client and server on my laptop — SQL Server 2005 Developer Edition on Vista Business SP1). Can Microsoft fix this?

  169. Understanding the error message: “Login failed for user ”. The user is not associated with a trusted

  170. David2 says:

    I have Microsoft SQL Serve, Error: 10061, 1326 and 18452.  I found out the problem actually comes from there is an alias exists under SQL Server Configuration Manager=>SQL Native Client Configuration=>Aliases.  I deleted the alias.  The problem solved.

  171. norisk says:

    I’m stuck with at 10054 "Forcibly closed" error when I try to connect to a Sql Server 2008 instance on a Windows 2008 Server from Sql Server 2008 Management Studio from a Vista machine. The stuff i’ve seen seems to think it might be network adapter problem, but I tried it from a nearby machine and they could connnect, but when I put their network card on my machine, it had not fixed the problem.

    What other than a network adapter issue might cause this problem? I already disabled the DoS entry in the Registy.

    Stuck.

  172. Danali says:

    I am trying to setup Database  Mirriroring  on SQL 2005.

    Database was setup  on the Mirror Server with No recovery . However when I try to start a mirror ,this is the error I receive

    The server network address ‘tcp:/mirror server ;5022’cannot be reached or does not exist .please check to make sure the network port for local and remote endpoints are operational .

    I have enabled TCPIP /Named pipes on both the parent and mirror server .

    Both Server are on the same domain and SQl service account are setup as domain admin login .

    Any ideas

  173. jchecketts says:

    Hi, I’m learning SQL on MS SQL Server 2005. I have a C# application on MS Visual Studio which is supposed to retrieve some values from a database and display them. The database and application are both on the same machine. In VS I can see and OPEN the database in the Server Explorer, I can see all tables, values, etc.

    I’m running

    MS SQL Server 2005 Express

    MS C# Visual Studio Express

    on a Windows XP SP2 machine

    But when I run the app, I get the

    Message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (.Net SqlClient Data Provider) error.

    TCP/IP and named pipes have both been enabled, to no avail, so I disabled them again. Exceptions for the sqlserver.exe and sqlbrowser.exe were also made in the firewall. Basically I’ve tried every fix and workaround I could find and  it just will not work. It seems ludicrous that I can see and access the db in VS but my app can’t.

     Should I persevere or, given that this seems to be a common and pervasive error with no well-defined solution, just change to a different SQL and stop f"#king about  with something that doesn’t work. I need to get things done and have already wasted about three days on this basic, basic issue.

    I suspect that the problem may be my connection string but I can’t find anywhere how to correctly define the connection string.  

     Help please!

  174. AspiringGeek says:

    jchecketts, this may address one of your questions:

    http://www.connectionstrings.com

  175. norisk says:

    Note that changes to the Surface Area are not reflected without restarting the service.

    Also, you can’t just allow the app, you have to open the ports by number (1433, 1434).

    Did you pull your connection string from your app or just build one from scratch? If you connect ok in VS, find the connection string and copy it.

    Note that SQL has a default instance and named instances when you have more than one version running. Make sure you are hitting on the right one.

    I REALLY appreciate your frustration. I recently wrote a long post to Microsoft about some of these issues and they said "We’ll keep these in mind".

    It is hard to be a one man shop and get anything done.

  176. bkloth says:

    Here is my issue:

    I am running VPC on a server.  I have installed SQL Server 2005 on the VPC.  I have changed the port for SQL Server from 1433 to 2633.  On my local machine, I can access the SQL Server database on the VPC by logging in with the following server name:  VPC-SERVER,2633.  However, when I create an alias on my local machine set to the VPC and Port 2633 and try to log in with the alias name, I get the following error:

    TITLE: Connect to Database Engine

    ——————————

    Cannot connect to VPC-ALIAS.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    Any ideas on why I can connect fine when I specify the port in the server name but not when I try to use an alias?  (I use aliases to connect to other non-VPC servers without issue.)

  177. bkloth says:

    Never mind my above issue.  Somehow it is working now.  Maybe I had an extra space at the end of the alias name or something because I changed it, and it worked, then I changed it back, and it worked again.

  178. CJ says:

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:40 – Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 53)

    How can i solve this?

    Thank you.

  179. ccm says:

    All,

      Please HELP ….. Thanks a lot in advance !!!

      I installed SQL Express 2005 on two new laptops with a default instance, using Windows log in accounts, enable TCP/IP at the end of the installations.

      One PC is up and running and connect to the remote server without any problem.

       However, the other one won’t connect.  when I tested the connection with "sqlcmd -S<SQL Server> -E", I got the following error —

    Sqlcmd: Error: Microsoft Native Client : Unable to complete login process due to delay in opening server connection.

        Please help, if you can.  Any help will be greatly appreciated.  Thank you all in advance for your time.

    Best Regards,

    ccm

  180. norisk says:

    The messages says, in effect, that "Under the default settings, this program doesn’t work." So, you installed an EMU – a bird that doesn’t fly. You have to use the Surface Area tool to allow Named Pipes – then restart the service for the changes to take place. WHY every release of Sql Server is shipped with a non-functional installation configuration is an incredible decision from Redmond and a source of a lot of bad taste regarding this product. You also need to check your ports if you are doing remote access.

    The connection string – build it with a wizard and copy it. Don’t try to figure it out on your own.

    http://woundedego.com

  181. alexwcy@hotmail.com says:

    Hi all, I have below error happend in my production server that running on Windows 2003 server and SQL Server 2005. Sometime happen and sometime not, may I know what is the caused? Thanks !

    Source = .Net SqlClient Data Provider

    Error = A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 – Not enough storage is available to complete this operation.) |    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

      at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

      at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

      at System.Data.SqlClient.SqlConnection.Open()

  182. slav says:

    hey guys. please help me with this problem.

    i got this conection string:

    String connectionString = @"Data Source=hostnameSQLEXPRESS;Database=pubs;Integrated Security=TRUE";

    and after compiling i get this error: Cannot open database "pubs" requested by the login. The login failed.

    and if i use the string without specifying database(just like that: String connectionString = @"Data Source=hostnameSQLEXPRESS;Integrated Security=TRUE";

    ) everything is fine.

    what should i do to connect to sql server on local machine at last? 1

  183. slav says:

    one more question. i’ve tried to find northwind or pubs database samples but i didn’t manage to do so. All i have is folder with Northwind as a SQL Server Compact Edition. are they compatible?

    so as i understand, i didn’t instal MSSQL 2005 properly. where can i find those samples(northwind, pubs) and where i should place them?

    Thank you for your attention.

  184. James Turner says:

    Just hopping that this will help in the solution of this problem!

    Server Error in ‘/’ Application.

    ——————————————————————————–

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

  185. Colin Graham says:

    i dont know if its any use but i had the problem relating to the following error message.

    SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed.

    anyway it transpired that i had inadvertently started using an old connect string that had "Integrated Security=True" as part of the string.

    Once i removed this everything worked fine. i hope this helps.

    <a href=’http://www.thewebbureau.com‘>web design belfast ireland</a>

  186. DeveloperSmith says:

    Well I have been getting this elusive error message for weeks now:

    An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error:40 – Could not open a connection to SQL Server)

    I tried everything suggested here and more, like setting my local connection setting to remote and local connection with TCP/IP and named pipes, adding the sqlserver.exe and sqlbrowser.exe to my firewall exceptions, change my data source from a period to (local), localhost, .SQLEXPRESS, and on and on, none of this helped.  I’m working on a Vista Home Premium laptop, with VS 2005 Pro and SQL Server 2005 Express.

    My solution: I removed all the above changes, put everything back to their default settings and then I changed my connection string in my code to look like the code below, hopefully this will work for you too:

    public const String ConnectionString =         @"Server=<myComputerName>SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=<myDatabaseName>";

    Note: This code is for a C# Windows app, the @ sign is important, it allows the backslash to not be treated as an escape character, and Server name needs to be named with your computer name followed by SQLEXPRESS

  187. AlexBB says:

    I have run into this problem which I consider a bug pertaining to both Sql Server and VS2008. When I try to set up a connection in Server Explorer of VS2008 to Sql Express or Sql Dev Edition I get a typical error that the remote connection cannot not be established. In fact it is. I double and triple checked everything numerous times. Also in fact I can connect to Sql Server via my C# programs using standard connection strings.

    It is still a minor issue. The major irritant is that after such an attempt I lose the ability to sign in to Sql Server management Studio.

    When it first happened last May I thought that I made a major error and it forced me to uninstall Sql Express and replace it with Sql Dev Edition. Last week I tried to set up a connection thru a dbml file with Linq Query Designer. It is supposed set up the connections in Server Explorer in VS2008 on the left. Exactly the same thing happen. Now I cannot get into Sql Management Studio.

    Not: It never happened with VS2005.

    Thanks. – Alex

  188. SAHIL says:

    TITLE: Connect to Server

    ——————————

    Cannot connect to SAHIL.

    ——————————

    ADDITIONAL INFORMATION:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

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

    ——————————

    BUTTONS:

    OK

    ——————————

  189. BiswaRanjan says:

    While i am scheduling my database back up,I have an error "Error: 18456, Severity: 14, State: 8." and

    "Error code 3041 for sql server 2005".

    Back up is not perform.

    wht is the sollution.

  190. Mahesh K says:

    Hi,

         I have installed SQL Server 2005 on a Vista Business. I am able to connect to SQL Server instance on Vista machine from Management Studio on other machine (Running on Xp).

         But I am not able to connect to Analysis Services default instance on Vista Business machine from Management Studio on other machine (Running on Xp).

         I did all settings with Vista firewall exceptions, SQL Surface area configuration, Security, everything.

         Please tell me do I need to modify something else on ‘Vista Business’.

         Thank you.

  191. SVK says:

    checked lots of things

    on using command at command promopt SQLCMD -S.SQLEXPRESS getting below msg

    HResult 0xFFFFFFFF, Level 16, State 1

    SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi

    shing a connection to the server. When connecting to SQL Server 2005, this failu

    re may be caused by the fact that under the default settings SQL Server does not

    allow remote connections..

    Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

    when trying to connet thr’ sql server management studio after registering the server  which

    doesnt show green dot . it shows white round means its not statrted

    and getting error msg

    An error has occurred while establishing a connection to the

    server.  When connecting to SQL Server 2005, this failure may be caused by the fact that

    under the default settings SQL Server does not allow remote connections. (provider: Named

    Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL

    Server, Error: 2)

    checked the tcp/ip, shared memory and named pipes all are enabled

    on using

    osql -E -surekhasvk

    getting below error

    [SQL Native Client]Named Pipes Provider: Could not open a connection to SQL

    Server [2].

    [SQL Native Client]Login timeout expired

    [SQL Native Client]An error has occurred while establishing a connection to

    the server. When connecting to SQL Server 2005, this failure may be caused by

    the fact that under the default settings SQL Server does not allow remote

    connections.

    if i install sql 2000 it works fine

    let me knw how culd i solve the connectivity problem

  192. SQL Protocols says:

    Hi SVK,

     It looks like your SQL Server instance is not started.  Start up services.msc, look for the SQL Server (SQLEXPRESS) service, and start it.  If you find that it was already started, verify that you are typing the name of the instance correctly (e.g., is it actually SQLEXPRESS, or is it named something else?).

    Hope this helps!

  193. Alex says:

    Login failed for user ‘web’. The user is not associated with a trusted SQL Server connection.

    How to associate this user with with a trusted SQL Server connection (I need script)

  194. greg aiken says:

    stand alone windows xp computer + sp2

    1. sql server configuration manager

         sql server 2005 network configuration

            protocols for SQLEXPRESS

               tcp/ip protocals (enabled)

                  ip address (tab)

                     ipall

                        tcp dynamic ports = 2101

    2. sqlexpress service stopped, then restarted successfully (running as ‘local system’ acct)

    3. in registry, confirmed that port 2101 was being used.

    4. in sql server log, confirmed that port 2101 was being used

    5. no firewalls running on my computer

    6. sqlbrowser service stopped, then restarted successfully (running as ‘local system’ acct)

    7.  running sqlcmd, where i explicitly specify tcp protocol and port number – does work

    C:>sqlcmd -S tcp:.sqlexpress,2101 -E

    1> exit

    8.  PROBLEM IS HERE. however running sqlcmd, where i specify tcp protocol and let sqlcmd figure out port to use (via interaction with sqlbrowser) does NOT work!

    C:>sqlcmd -S tcp:.sqlexpress -E

    HResult 0xFFFFFFFF, Level 16, State 1

    SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].

    Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi

    shing a connection to the server. When connecting to SQL Server 2005, this failu

    re may be caused by the fact that under the default settings SQL Server does not

    allow remote connections..

    Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

    UNQUALIFIED ASSESSMENT:

    it appears to me that either something is wrong with the client connectivity library (im not sure if ‘sqlcmd’ actually uses ‘sqloledb’ or ‘sqlncli’).

    or something is wrong with the interaction between the client library and sqlbrowser.

    i do not know how to troubleshoot further…  

    any help would be GREATLY APPRECIATED

  195. Raf says:

    Turkish error mesage:"Sunucuyla bağlantı kurulurken hata oluştu. Bu hata, SQL Server 2005’e bağlanılırken, SQL Server’ın uzak bağlantılara izin vermediği varsayılan ayarlar altında oluşan durum nedeniyle oluşabilir. (provider: Adlandırılmış Kanal Sağlayıcısı, error: 40 – SQL Server için bağlantı açılamadı) (.Net SqlClient Data Provider)"

    i couldnt resolve my problem…

  196. Jason says:

    I get the following error when executing SQL Server 2005 SSIS packages that transfer data from one server to another using OLE DB Source and Destination components.

    [OLE DB Source – Agreement [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Protocol error in TDS stream". An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Protocol error in TDS stream". An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Protocol error in TDS stream". An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Communication link failure". An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "TCP Provider: An existing connection was forcibly closed by the remote host. ".

    Thanks

  197. Raju says:

    I got the following error while making connection to sql server 2005 :

    "An error has occured while establishing a connection to the server. when connecting to sqlserver 2005, this failure may be caused by the fact that under default settings SQL server does not allow remote connections.

    (Provider: Named Pipes Provider, error : 40 – could not open a connection to SQL server )(Microsoft SQL SERVER, ERROR : 2)"

    Can anyone help me out to fix it ?

  198. Bill Ross says:

    Not everyone who successfully connects to their SQL server is a SQL genius. By walking through the wizard in Management Studio one can connect pretty easily and then just copy the connection string that is generated. Just know that VS will reformat it and you need to get rid of the added quotation marks.

  199. Larry Van Brunt says:

    From SQL Server Management Studio I get the following error connecting to a SQL server in a different domain:

    Login failed for user ”. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)

    On the server Application event log I get:

    SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed.

    And on the server System Event Log I get:

    The kerberos subsystem encountered a PAC verification failure.  This indicates that the PAC from the client "insertnamehere" in realm "DomainHere" had a PAC which failed to verify or was modified.  Contact your system administrator.

    I have removed the server from the domain and re-added it. Reinstalled SP2 and still get the error. I am able to connect to other sql servers in the domain without incident – just this one.

  200. Rakesh Krishna says:

    The Request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details

  201. Rakesh Krishna says:

    Hi Guys,

       This is th error

             The Request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details.

    I got when i am starting the SQL SERVER(MSSQLSERVER) &

    SQL Server Agent(MSSQLSERVER) from the SQL Server

    Configuration Manager .

    Waiting for your Kindly Reply

    Thanks,

  202. ChileuMM says:

    I am getting exactly the same error but when I try to start the SSIS from my EM, any ideas are highly appreciated.

  203. Joy Corales says:

    IS there a possible solution in this error rather than re executing the batch??

    Sqlcmd: Error: Microsoft SQL Native Client : Unable to complete login process due to delay in opening server connection.

  204. vaibhav says:

    I HAVE WINDOWS VISTA HOME PREMIUM(SP1)

    i am facing problem during login to sql server.

    pl do the needful.

    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

  205. Shabaz says:

    I am not able to access sql browser it is not showing that in sql server. Does any one suggest me how to connect to sql server.

    Thanks.

  206. Jatin says:

    Please provide me any help for this error.

    A transport level error has occured when receiving results from the server.

    (provider: TCP Provider,error: 0 – The semaphore timeout period has expired.

    Thanks.

  207. Drigg says:

    Your story was featured in Drigg! Here is the link to vote it up and promote it: http://wordgeist.com/Programming/SQL_Server_2005_connectivity_error_messages

  208. Ketan Jajal says:

    Hi,

    I have Installed SQL Server 2005, when i try to telnet, it fails, OS :- Winxp

  209. Dreadful error "A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 – No process is on the other end of the pipe.)" SOLVED, at least in my case:

    CLR client code was calling a CLR Stored Procedure that resultet in above error message.  The problem turned out to be date-values initiate to "zero-date", i.e. "12:00:00 AM" (with year 0).  Normally, this gives decent error message stating something like "SQL Server does not accept dates with year<1753".  I have a Stored Procedure with 94 parameters, AND THIS SEEMS TO CORRUPT PROPER ERROR HANDLING.  (I have some time ago read that SQL Server debugging from Visual Studio not is possible if the total parameter-size exeeds some 256 or 512 bytes, which is not very much….).

    MICROSOFT:  Please look into this, real-life Stored Procedures easily add/updates objects with houndreds or more parameters.

    Best regards,

    Bjørn Sigurd Johansen

    Norway

  210. horhay1973 says:

    I am currently installing windows update, and a perfectly working PC suddely now starts giving the error message below :-

    Microsoft SQL Server Login:

    Connection failed:

    SQLState: ‘01000’

    SQL Server Error: 53

    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen(Connect()).

    Connection failed:

    SQLState: ‘08001’

    SQL Server Error: 17

    [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

    ………………………………………………

    how can i solve this error?

  211. Jose Luis Cocha says:

    DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "Login timeout expired".  An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".  An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80004005  Description: "TCP Provider: No such host is known.

  212. student says:

    it will be very nice of u ,if u can fix this problem……

  213. student says:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

  214. Octavian Cucuta says:

    Christopher, THANK YOU!!!

    Christopher Cheng said:

    For those who gave up, try one more thing:

    Start "SQL Server Configuration Manager",

    In "SQL Server 2005 Network Configuration" > "Protocols for SQLEXPRESS", Click on the tab "IP Addresses", Change all TCP Port to 1433.

    Yes, I mean all, even "IPAll", then it will work!

  215. Jony says:

    Hi

    i was also facing the problem when connecting sql server 2005 with sqlconnection then i also got the following error message

    Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

    I referred the following url and solved

    http://sqlservererror-info.blogspot.com/2009/07/error-has-occurred-while-establishing.html

    Regards

  216. Susan says:

    Hi

    I got the reasons for the following error. This error is comming because you have to enable remote connection for sql server

    Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server.

    When connecting to SQL Server 2005, this failure may be caused by the fact that under

    the default settings SQL Server does not allow remote connections.

    In the following url theire is ways to enable remote connections in sql server

    http://sqlservererror-info.blogspot.com/2009/07/error-has-occurred-while-establishing.html

    Regards

  217. Saurabh says:

    i’ve installed sql server 2005, all successfully. but when i tried to start it. In CONNECT TO SERVER dialog box, the SERVER NAME labled combo-box doesn’t show any server. What should i do? i’ve reinstalled it twice. but it didn’t help.

    PLZ HELP ME.

    THANX

  218. Saurabh says:

    i’ve installed sql server 2005, all successfully. but when i tried to start it. In CONNECT TO SERVER dialog box, the SERVER NAME labled combo-box doesn’t show any server.

    i want to work on the LOCAL COMPUTER/SERVER for study purpose only. no REMOTE CONNECTION.

    What should i do? i’ve reinstalled it twice. but it didn’t help.

    PLZ HELP ME.

    THANX

  219. Blarg says:

    Please make sure the "SQL Server Browser" service is enabled and started.  I have seen this service disabled on servers where there is an Error 26, unable to connect.

  220. Jucabel says:

    I have a problem … I’m doing a server of an online game but I am asked as a condition SQLServer 2005 Express magnement … when I install this and follow all instances that I finally called the game … I get an error trying to connect to the game program to edit …

    says:

    Error in connection:

    SQLState: 08001

    SQL Server Error: 2

    [Microsoft] [SQL Native Client] Named Pipes Provider: I can not open a connection to SQL Server [2].

    Error in the connection

    SQLState: HYT00

    SQL Server Error: 0

    [Microsoft] [SQL Native Client] has ended the waiting time logon

    Error in connection:

    SQLState: 08001

    SQL Server Error: 2

    [Microsoft] [SQL Native Client] An error while establishing a connection to the server. When connecting to SQL server 2005, the default settings SQL Server does not allow remote connections.

  221. Ishan says:

    Try restarting the SQL server service.

    go to Windows + R and type services.msc

  222. shantanufrom4387 says:

    Here are the steps to resolve this error. It worked for me. It is a very nice documented tutorial along with the video.

    http://techpint.com/programming/error-26-%E2%80%93-error-locating-serverinstance-specified-sql-server

  223. Hussein says:

    Hello,

    can anybody help please,

    when I connect from MS access client machine to my SQL server 2005 I get the following error:-

    Connection failed

    SQLStatus:’01000′

    SQL server error:53

    [Microsoft][ODBC SQL SERVER Driver][DBNETLIB]Connectionopen(Connect()).

    Connection faild:

    SQLStatus:’08001′

    SQL server error:17

    [Microsoft][ODBC SQL SERVER Driver][DBNETLIB]SQL sever doesn’t exist or access denied.

  224. Tony says:

    Thanks, just the number 0x274C, Level 16, State 1  found above has indicated that my server (the company hosting it) has a firewall blocking remote SQL.

  225. jyoti says:

    System.Data.SqlClient.SqlException: An error has occurred while establishing

    a connection to the server. When connecting to SQL Server 2005,

    this failure may be caused by the fact that under the default

    settings SQL Server does not allow remote connections.

    (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

    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,

    qlConnectionString 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.CreatePooledConnection(DbConnection owningConnection,

    DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.

    CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection

    owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) 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 _Default.Login1_Authenticate(Object sender, AuthenticateEventArgs e)

    in f:JYOTI DATADOTNET PROJECT DETAIlPracticeWorkDataCheck.aspx.cs:line 30

  226. nagaraju says:

    Hi ,This is my server problem . please solve this problem.

    Cannot connect to SHIVA.

    ——————————

    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) (Microsoft SQL Server, Error: 2)

    OK

    ——————————

  227. norisk says:

    As I understand this, "Named Pipes" is the default protocol, but is not available by default (and is only relevant to an installation on the same machine). So, either use TCP/IP or use the Surface Area Configuration tool to allow Named Pipes (if your SQL Server is on the same machine as your client).

  228. Amrita says:

    Hi this is Amrita,i m useing sql 2005 in dotnetnuke so its giving an Error of sql

    The stored procedure ‘dbo.UpdateDatabaseVersionAndName’ doesn’t exist.

    As a Dotnetnuke solutions they are providing me option to resolve this problem is to use ‘db owner’so please can any one guide how i can set the db owner in my sql server management studio express and i am also not able to create new database in sql,it gaves me an ERROR:

    CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 1807)

    please help me out

    Thanks

    Amrita Vishnoi

  229. kumar says:

    i have installed sql server 2005 express edition ….

    but i unable to connect to the server..

    i have an error message like…. you could not open a connection…. error code 2

                  error code 40

  230. Divya says:

    Hi,

      I Had a Problem in the sql server login..

    connection failed:

    sql state:’08001′

    sql server error: 53

    [microsoft][sql native client]named pipes provider:could open a connection to sql server[53]

    connection failed:

    sql state:’HYT00′

    SQL Server error:

    [microsoft][sql native client]login timed out expired.

    connection failed:

    sql state:’08001′

    sql server error: 53

    please let me know the answer soon.

    Thanks in Advance.

  231. Mujahed says:

    what does sqlerror message sqm1011 mean???

  232. Patty says:

    In running a backup of a SQL Database I am getting the following error on an intermittent basis:

    ERROR: Function Name – BackUpDB

    Wednesday, February 10, 2010 9:16:35 PM : ERROR Message : A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 – The pipe has been ended.)

    Most nights the backup works, but I have received this failure 3 times in the last month.  Actually, this was the first time, the second and third, the log just stopped without a completed backup – no error messages, but the database is in single user mode.  I have to detach and reattach to take it out of single user so I can perfom the backup and get people back in.

    Could this be a resource problem, such as lack of memory?

  233. Tunisien86 says:

    Hi

    I follow this document http://msdn.microsoft.com/en-us/library/ms171908(SQL.90).aspx step by step for go to replication but 2 issues still:

    1)When trying to change the user account(when configuring my web synchronize for my publication)from the default account IUSR to my own account  an error  message appears:

    The program can not open the required dialog box because no location has been found.Close this message and try again

    2) Im having problem setting up merge replication between SQL 2005 and SQL Compact Edition, I have done Merge replications several times before never ran into this problem…

    During setup for a new subscriber after I entered all required parameters, the subscription wizard does an initial data synchronization, and it fails at that point with error message of "Failure to connect to SQL Server with provided connection information. SQL Server does not exist, access is denied because the SQL user is not a valid user on the SQL Server, or the password is incorrect.

    HRESULT 0x80004005 (29060) "

    I created many logins, used the sa login, but nothing happens, when I tried Windows Authentication the error message changes to "Failure to connect to SQL Server with provided connection information. SQL Server does not exist, access is denied because the IIS user is not a valid user on the SQL Server, or the password is incorrect.

    HRESULT 0x80004005 (29061) " even though the iUser is a defined login in SQL Server.

    I use web synchronization, the subscriber connects anonymously to the publisher, I tried the url of http://servername/virtualDirectoryName/sqlcesa30.dll in IE explorer & it’s working, ran snapshot agent & it’s working, Im sure Im giving the right permissions on the right folders, snapshot folder & virtual directory folder.

    Note: I dont know if this has anything to do with this issue, but it seems to happen when I created a new user account on the same server which running windows server 2003.

    Also I have found another one experiencing same issue http://dbaspot.com/forums/ms-sqlserver/269848-synchronisation-failing-sql-ce-database.html , his problem was solved by a thread he supplied http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=193693&SiteID=1 but this link is broken , he said something about "creating the Alias under SQL Native Client Configuration".

    Any suggestion would be appreciated.

    Thanks

  234. Niranjan says:

    Violation of PRIMARY KEY constraint ‘PK_Purchase_Ord’. Cannot insert duplicate key in object ‘dbo.Purchase_Ord’.

    The statement has been terminated.

  235. sulthan says:

    i have the error of instance failure while i am connecting to the sql server 05.i need resolution for that.

  236. Humberto says:

    Hello All,

    I got an similar error that you mentioned above:

    2010-07-06 11:16:58.90 Logon       Error: 17806, Severity: 20, State: 2.

    2010-07-06 11:16:58.90 Logon       SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 164.4.57.61]

    2010-07-06 11:16:58.90 Logon       Error: 18452, Severity: 14, State: 1.

    2010-07-06 11:16:58.90 Logon       Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 164.4.57.61]

    But I´m trying to find out the solution in the links provided but  this Dosent has the solution, kindly provide an assistance…

  237. Tony says:

    Arrived at work this morning with panic breaking loose and there was the following message within the event viewer on the sql server machine:

    Event Type: Error

    Event Source: MSSQL$SQLEXPRESS

    Event Category: (4)

    Event ID: 17827

    Date: 15/09/2010

    Time: 22:06:11

    User: N/A

    Computer: DATASERV1

    Description:

    There was a failure while attempting to encrypt a password. The connection has been closed. [CLIENT: <local machine>]

    For more information, see Help and Support Center at go.microsoft.com/…/events.asp.

    Data:

    0000: a3 45 00 00 14 00 00 00   £E……

    0008: 15 00 00 00 44 00 41 00   ….D.A.

    0010: 54 00 41 00 53 00 45 00   T.A.S.E.

    0018: 52 00 56 00 31 00 5c 00   R.V.1..

    0020: 53 00 51 00 4c 00 45 00   S.Q.L.E.

    0028: 58 00 50 00 52 00 45 00   X.P.R.E.

    0030: 53 00 53 00 00 00 00 00   S.S…..

    0038: 00 00                     ..      

    There was a failure while attempting to encrypt a password. The connection has been closed. [CLIENT: <local machine>]

    It started at a seemingly random time last night?  Its a SQLEXPRESS 2005 install.  A reboot sorted it but am trying to find out the cause?!?!

  238. Mouse says:

    My solution for login errors:

    SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. AND Login failed for user ''. The user is not associated with a trusted SQL Server connection.

    1. Logoff all remote users from that server (i used "tsadmin" for that)

    2. Connect to SQL instance again

  239. shrikant says:

    An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

  240. Ning says:

    Yes. It works!!!! Thanks so much, Cheng!!

    Christopher Cheng 21 Mar 2006 12:54 AM

    For those who gave up, try one more thing:

    Start "SQL Server Configuration Manager",

    In "SQL Server 2005 Network Configuration" > "Protocols for SQLEXPRESS", Click on the tab "IP Addresses", Change all TCP Port to 1433.

    Yes, I mean all, even "IPAll", then it will work!

  241. used ibm computers says:

    I just stumbled upon your blog after reading your blog posts wanted to say thanks.i highly appreciate the blogger for doing this effort.

  242. Muhammad Bilal says:

    My sql server 2005 showing error no 40 during connectinge with server.

  243. Sriyantha Silva says:

    Suddenly my site was not responding and took long time when opened with a new browser,

    then I was nothing to do that I just check server even for any error information, there saw the error with a below detail,

    "OLE DB error: OLE DB or ODBC error: Communication link failure; 08S01; Shared Memory Provider: No process is on the other end of the pipe."

    then I moved to SSMS and try to connect server for my verification (I have named instance, SSAS also in the same server) it was worked fine then I realized there were nothing to do with server. but I managed to restart all the server related services.

    even that I was not resolved the issue, I restarted IIS Admin Services and reopen the site  again

    Wondered, it was work for me.

  244. surya says:

    when i am trying to install a 3d software sql is not installing its giving following code "Error code :  -2068578304(0)" .What would be the reason for this. Please some one help me to resolve this issue.

  245. Who is wrong says:

    •Remote OLEDB connection using TCP to a server that is blocked by Firewall

    In this who is the culprit the server in which App is hosted or the one in which DB is hosted.?

  246. Arıtma Sistemleri says:

    when I try to connect https://www.tesaritma.com.tr using SQL connection, it gives "connection refused" I am suspecting it may cause from a network failure (slow connection) how do I increase the timeout value?

  247. Otel Tekstili says:

    I get the same error with https://www.beltatex.com how do we increase SQL connection timeout?

  248. Arama Motoru says:

    Hello,

    I am using MS SQL, a transport-level error has occurred when receiving results from the server. How do we adjust the memory limit?

    https://www.seoprix.com