SQL SERVER – Fix: Error: HResult 0x2, Named Pipes Provider: Could not open a connection

In this blog post we are going to fix the error which is related to Named Pipes Provider. The full error reads HResult 0x2, followed by could not open a connection to SQL Server.

Error:

HResult 0x2, Level16, State 1
Named Pipes Provider: Could not open a connection to 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..
Sqlcmd: Error: Microsoft SQL native Client : Login timeout expired

Solution/Fix/WorkAround:
By default SQL Server 2005 has TCP/IP connections disabled. To enable TCP/IP support, use the SQL Server Configuration Manager tool, select SQL Server 2005 Network Configuration, select Protocols, double-click on TCP/IP, and turn on Enabled.

AND

By default SQL Server 2005 has Named Pipes connections disabled. To enable Named Pipes support, use the SQL Server Configuration Manager tool, select SQL Server 2005 Network Configuration, select Protocols, double-click on Named Pipes, and turn on Enabled.

SQL server configuration manager window.

In the latest version of the SQL Server, I have not seen happening this error anymore. However, it is still relevant and if you are using SQL Server 2005 or 2008, I am sure you will find this error during installation and with the help of this blog you can fix it.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

Computer Network, SQL Error Messages, SQL Server
Previous Post
SQL SERVER – Fix : Error 2501 : Cannot find a table or object with the name . Check the system catalog.
Next Post
How the Main System Views Connect

Related Posts

14 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.