Currently,SQL Services are using TCP IP protocol. Named pipes protocol is disabled. I am facing issues while running my application status as below :

An error has occurred while establishing a connection to the server. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)

My Question is ,Will there be any issue if I enable Named Pipes now because I restarted the Named Pipes and restarted SQL Service and issue seems to be resolved. But I am confused why we are getting Named Pipes issue when TCP IP is enabled. Does SQL Server need both TCP IP and Named Pipes to be enabled ?

Thank you

1 Answer 1


It's because,

When a client tries to make a connection, it uses the protocols order by priority defined by SQL Server configuration manager. A low value means a high priority. If you configured TCP/IP as first priority and SQL Server is not able to resolve Name to IP it raise the error you posted. But when you disable TCP/IP, then because TCP/IP with first priority is disabled client uses Named Pipe (with second priority) to connect to SQL Server. And get a successful connection.

Here, you can set the priority of protocols by moving it UP or DOWN.

enter image description here


  • Rajesh can you please let me know how I find protocol priority Aug 30, 2016 at 11:31
  • 1
    You can set it in Client Protocols, added image in my post. Aug 30, 2016 at 12:27
  • Thanks Rajesh for the information.Will check it out and will get back. Aug 30, 2016 at 12:45
  • Rajesh, one last question. Do you suggest enabling Named Pipes as well. Because as per your case if TCP/IP is not able to resolve Name to IP,I think Named Pipes should be enabled ? But Already in all our servers TCP IP protocol is enabled already. Just need to know if enabling Named Pipes is a good idea or not .Please suggest . Aug 30, 2016 at 13:40
  • @SQLBoy All the protocols used for difference purposes. you can go through the URL technet.microsoft.com/en-us/library/ms187892(v=sql.120).aspx. It should be enable but, when you'll try to connect using IP address of SQL Sevrer and TCP/IP is disable (with priority set to 1) then you'll not able to connect SQL Server. But if you connect using SERVER_NAME (TCP/IP priority set to 1) and client resolves name to IP in that case if client could not connect using TCP/IP, the connection will move to Named Pipe protocol. Aug 30, 2016 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.