Microsoft KB Archive/839269

= You may not be able to connect to an instance of SQL Server that is configured to use the Named Pipes server network library on a computer that is running Windows XP Service Pack 2 =

Article ID: 839269

Article Last Modified on 12/9/2005

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 2000 Desktop Engine (Windows)
 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 7.0 Desktop Edition
 * Microsoft Windows XP Embedded
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Express Edition
 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Workgroup Edition

-



SYMPTOMS
You may not be able to connect to an instance of SQL Server, and you may receive one of the following error messages.

Error message 1

[Named Pipes]SQL Server does not exist or access denied.

[Named Pipes]ConnectionOpen (Connect).

Error message 2

Unable to connect to server < >

Server: Msg 17, Level 16, State 1

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

Error message 3

Cannot connect to < >

This behavior occurs when you do one of the following:
 * You try to connect to an instance of SQL Server that is installed on a computer that is running Microsoft Windows XP Service Pack 2.
 * You try to connect to an instance of SQL Server that is configured to listen on the Named Pipes server network library only.



CAUSE
By default, Windows Firewall is enabled on computers that are running Microsoft Windows XP Service Pack 2. Windows Firewall closes ports such as 445 that are used for file and printer sharing to prevent Internet computers from connecting to file and print shares on your computer.

When SQL Server is configured to listen for incoming client connections by using named pipes over a NetBIOS session, SQL Server communicates over TCP port 445, just like file and printer sharing. Therefore, the SQL Server clients that are trying to connect to SQL Server receive the error messages that are mentioned in the &quot;Symptoms&quot; section.



RESOLUTION
To resolve this problem, you must enable the TCP port 445 explicitly. To do this, use one of the following methods.  Enable TCP port 445 by changing the network connection settings.

To do this, follow these steps:  Click Start, and then click Run. In the Run dialog box, type Firewall.cpl, and then click OK. In the Windows Firewall dialog box, click the Advanced tab. Under Network Connection Settings, click your network connection, and then click Settings. In the Advanced Settings dialog box, click Add on the Services tab. In the Service Settings dialog box, set the values as specified below, and then click OK.

Note Make sure that the TCP option is selected in the Service Settings dialog box.</li></ol> </li> Enable TCP port 445 by enabling file and printer sharing.

To do this, follow these steps: <ol> Click Start, and then click Run.</li> In the Run dialog box, type Firewall.cpl, and then click OK.</li> In the Windows Firewall dialog box, click the Exceptions tab.</li> Under Programs and Services, click to select the File and Printer Sharing check box, and then click Edit.</li> In the Edit a Service dialog box, click to select the TCP 445 check box, and then click OK two times.</li></ol> </li></ul>

<div class="workaround_section">

WORKAROUND
To work around this problem, you can use the TCP/IP sockets network library. You can create an alias for the computer that is running SQL Server that uses the TCP/IP Sockets library or you can use TCP/IP as the only default enabled protocol. To add a SQL Server alias that uses TCP/IP Sockets library, follow these steps:
 * 1) Click Start, click Run, type cliconfg, and then click OK.
 * 2) In the SQL Server Client Network Utility dialog box, click the Alias tab, and then click Add.
 * 3) In the Add Network Library Configuration dialog box, under Network libraries, click TCP/IP.
 * 4) In the Server alias box, type the IP address of the computer or the name of the computer that is running SQL Server, and then click OK.

<div class="status_section">

STATUS
This behavior is by design.

<div class="references_section">