I am Dale Hayter, a Microsoft and VMware certified Technical Consultant.

My blog has been built up over the years from my experience of working on an IT helpdesk and also from being out on-site.

SQLCMD – Named Pipes Provider: Could not open a connection to SQL Server

There might be occasions when trying to connect to a SQL 2008 R2 Instance with SQLCMD that you might receive the error :-

Named Pipes Provider: Could not open a connection to SQL Server. Microsoft SQL Server Native Client 10.0 : Login timeout expired. 

The full error can be seen in the screenshot below :

SQLCMD4

The issue is caused by something to do with the value that is returned by default in the configured Named pipes. To stop this happening and to allow us to connect we need to do the steps below :-

– Open SQL Server Configuration Manager
– Branch out SQL Server Network Configuration
– Click on the Protocols for your instance.
– In the right hand pane, right click on Named pipes and then click properties.

SQLCMD2

– Change the value in the field Pipe Name to

\\.\pipe\sql\query
SQLCMD3

Click ok. Then restart the SQL Instance. You should now be able to connect to the instance.