Microsoft KB Archive/265808

= How to connect to a named instance of SQL Server 2005 or SQL Server 2000 by using the client tools in the earlier version of SQL Server =

Article ID: 265808

Article Last Modified on 11/2/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Express Edition
 * Microsoft SQL Server 2005 Workgroup Edition
 * Microsoft SQL Server 2000 Personal Edition
 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 2000 Workgroup Edition
 * Microsoft SQL Server 2000 Developer Edition
 * Microsoft SQL Server 2000 Enterprise Edition
 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q265808



SUMMARY
Microsoft SQL Server 2005 and Microsoft SQL Server 2000 introduce multiple instances. However, client tools such as Query Analyzer or ISQL/W, which are available with earlier versions of Microsoft SQL Server, may experience difficulty connecting to the non-default named instances. For example, if you try to connect to a named instance by using \\ \, the client tools may return this error message:

Error: \\ \

unable to connect server \\ \

Server: Msg 67, Level 61, State 1 [Microsoft][ODBC SQL Server Driver] Client unable to establish connection.



MORE INFORMATION
You must have Microsoft Data Access Components (MDAC) version 2.6 or a later version to connect to a named instance by using the \\ \ format. We recommend that you upgrade the client tools and MDAC version to work with SQL Server 2005 or SQL Server 2000.

However, a workaround is possible by using server aliases on a client computer that only has client tools of earlier versions and MDAC installed. Be aware that this workaround provides limited functionality. You cannot use Microsoft SQL Server 7.0 Enterprise Manager to manage SQL Server 2005 or SQL Server 2000, although you can connect to a named instance of SQL Server 2005 or a named instance of SQL Server 2000 by using the SQL Server 7.0 client tools Query Analyzer and Osql.exe, or by using the Microsoft SQL Server 6.5 client tools ISQL/W and Isql.exe.

The following steps describe how to configure a server alias to use either TCP/IP sockets or Named Pipes to connect to a named instance of SQL Server 2000 or a named instance of SQL Server 2005 directly, without having to specify the named instance name.

Configure a server alias to use TCP/IP sockets
Note To configure a server alias to use TCP/IP sockets, you must provide the server name and the TCP/IP port number.  Determine the TCP/IP port number of the instance of SQL Server.

SQL Server 2005  Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration. Click Protocols for , and then double-click TCP/IP in the right panel.

Note  is a placeholder for the named instance of SQL Server 2005. On the Protocol tab, notice the value of the Listen All item. Click the IP Addresses tab:  If the value of Listen All is yes, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item under IPAll. If the value of Listen All is no, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item for a specific IP address.</li></ul>

Note If the value of the TCP Dynamic Ports item is not set, you must set it yourself. For more information about how to configure a server to listen on a specific TCP port, visit the following Microsoft Developer Network (MSDN) Web site: http://msdn2.microsoft.com/en-us/library/ms177440.aspx</li> Click OK.</li></ol>

SQL Server 2000 <ol style="list-style-type: lower-alpha;"> On the server that is running SQL Server 2000, start the Server Network Utility.</li> Click the General tab, and then select the instance that you want from the Instances list.</li> Click TCP/IP, and then click Properties. The TCP/IP port number for this instance is shown. Note this number for use later.</li></ol> </li> Configure the server alias on the client computer.

SQL Server 2000 <ol style="list-style-type: lower-alpha;"> Start the Client Network Utility.</li> On the General tab, verify that TCP/IP appears in the list under Enabled protocols by order.</li> Click the Alias tab, and then click Add.</li> Under Network libraries, select TCP/IP.</li> In the Server name text box, type the IP address of the server that is running SQL Server 2005.

Note The IP address that you type here is the one that is configured to use the TCP/IP port number.</li> Click to clear the Dynamically determine port check box, and then type the port number of the instance of SQL Server 2005 in the Port number text box.</li> Type a name in the Server alias text box, and then click OK.</li></ol>

SQL Server 7.0 <ol style="list-style-type: lower-alpha;"> Start the Client Network Utility.</li> On the General tab of the Server Alias Configuration dialog box, click Add, and then click TCP/IP.</li> Type an alias name in the Server Alias text box. The alias can contain any name.</li> <li>Type the SQL Server 2000 computer name or the SQL Server 2000 IP address in the Computer Name text box. Do not add an instance name.</li> <li>In the Port Number text box, type the port number that you recorded in step 1. Click 'OK' two times.</li></ol>

SQL Server 6.5 <ol style="list-style-type: lower-alpha;"> <li>Start the SQL Server Client Configuration Utility.</li> <li>Click the Advanced tab, and then click Add/Modify.</li> <li>Type an alias name in the Server text box.</li> <li>Select TCP/IP Sockets as the DLL name.</li> <li>In the connection string, type the name of the computer that is running SQL Server followed by a comma (&quot;,&quot;) and the port number you recorded in step 1. For example:

ComputerA, 1523

Do not add an instance name. Click Add/Modify.</li> <li>Click Done.

Note SQL Server 6.5 does not support trusted connections with TCP/IP. Therefore, you might see the following error message when you use TCP/IP sockets to make a trusted connection to SQL Server 2000 by using SQL Server 6.5 client tools:

Msg 18452, Level 14, State 1: Login failed for user 'user_name'. Reason: Not associated with a trusted SQL Server connection. DB-Library: Login incorrect.

Use Named Pipes to make a trusted connection when you use SQL Server 6.5 client tools.</li></ol> </li></ol>

Now you can use the server alias to connect to a named instance of SQL Server 2005 or a named instance of SQL Server 2000 by using the SQL Server 7.0 client tools Query Analyzer and Osql.exe, or by using the SQL Server 6.5 client tools ISQL/W and Isql.exe.

Configure a server alias to use Named Pipes
Note To configure an alias to use Named Pipes, you must provide a server name and a pipe name. <ol> <li>Determine the pipe name of the server instance.

SQL Server 2005 <ol style="list-style-type: lower-alpha;"> <li>Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration.</li> <li>Click Protocols for , and then double-click Named Pipes in the rightmost panel.</li> <li>On the Protocol tab, notice the value of the Pipe Name item. The value of the Pipe Name item specifies the named pipe that SQL Server listens on.

Note If the value of the Pipe Name item is not set, you must set it yourself. For more information about how to configure a server to listen on an alternate pipe, visit the following MSDN Web site: http://msdn2.microsoft.com/en-us/library/ms189321.aspx</li> <li>Click OK.</li></ol>

SQL Server 2000 <ol style="list-style-type: lower-alpha;"> <li>On the server that is running SQL Server 2000, start the Server Network Utility.</li> <li>On the General tab, click the instance that you want in the Instances list.</li> <li>Click Named Pipes, and then click Properties. Note the pipe name for use later.</li></ol> </li> <li>Configure the server alias on the client computer.

SQL Server 2000 <ol style="list-style-type: lower-alpha;"> <li>Start the Client Network Utility.</li> <li>On the General tab, verify that Named Pipes is in the list under Enabled protocols by order.</li> <li>Click the Alias tab, and then click Add.</li> <li>Under Network libraries, select Named Pipes.</li> <li>In the Pipe name text box, type the pipe name of the server that is running SQL Server 2005. Then replace the first dot (.) in the pipe name with the IP address of the server that is running SQL Server 2005. For example, if the pipe name that you obtain from the instance of SQL Server 2005 is \\.\pipe\MSSQL$Instance\sql\query, you must type \\ \pipe\MSSQL$Instance\sql\query.

Note &quot;IPAddress&quot; is a placeholder for the IP address of the server that is running SQL Server 2005.</li> <li>Type a name in the Server alias text box, and then click OK.</li></ol>

SQL Server 7.0 <ol style="list-style-type: lower-alpha;"> <li>Start the Client Network Utility.</li> <li>On the General tab of the Server Alias Configuration dialog box, click Add, and then click Named Pipes.</li> <li>Type an alias name in the Server Alias text box. The alias can contain any name.</li> <li>Type the pipe name that you recorded from step 1.</li> <li>Make sure that you change the &quot;.&quot; (period) to the actual name of the computer that is running SQL Server. For example:

\\ComputerA\pipe\MSSQL$s2000\sql\query

Do not add the instance name. Click OK two times.</li></ol>

SQL Server 6.5 <ol style="list-style-type: lower-alpha;"> <li>Start the SQL Server Client Configuration Utility.</li> <li>Click the Advanced tab.</li> <li>Type an alias name in the Server text box.</li> <li>Select Named Pipes as the DLL name.</li> <li>In the connection string, type the pipe name that you recorded in step 1.</li> <li>Make sure that you change the &quot;.&quot; (period) to the actual name of the computer that is running SQL Server.

For example:

\\ComputerA\pipe\MSSQL$s2000\sql\query

Do not add the instance name.</li> <li>Click Add/Modify, and then click Done.</li></ol> </li></ol>

Now you can use the server alias to connect to the instance by using by using the SQL Server 7.0 client tools Query Analyzer and Osql.exe, or by using the SQL Server 6.5 client tools ISQL/W and Isql.exe.

Keywords: kbinfo KB265808

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.