HResult 0x2, Level 16, State 1 Named Pipes Provider: Could not open aconnection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL ServerNative Client 10.0 : A network-related or in stance-specific error hasoccurred while establishing a connection to SQL Server . Server is notfound or not accessible. Sqlcmd: Error: Microsoft SQL Server NativeClient 10.0 : Login timeout expired.

After installing new  SQL server 2008 R2 in Windows Server and connection to sql using “sqlcmd.exe” in command prompt gave below error-
HResult 0x2, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [2]. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or in stance-specific error has occurred while establishing a connection to SQL Server . Server is not found or not accessible. Check if instance name is correct and i f SQL Server is configured to allow remote connections. For more information see  SQL Server Books Online.. Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.

To fix this problem , change the Named pipe value from below \\.\pipe\MSSQL$SQLEXPRESS\sql\query to

\\.\pipe\sql\query using SQL Server Configuration Manager.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s