Microsoft KB Archive/38695

From BetaArchive Wiki

PRB: Cannot Connect to SQL Server Using ISQL/SAF/SQLTEST(R/P)

ID: Q38695

The information in this article applies to:

  • Microsoft SQL Server for OS/2, version 4.2


After successfully installing SQL Server, the following error message appears when trying to connect to it from a workstation using ISQL, SAF, or SQLTEST(R/P):

Operating-system error:
Open failed on network pipe : \PIPE\SQL\QUERY
Unable to connect: SQL Server is unavailable or does not exist.


Before starting SQL Server with NET START SQLSERVER, the LAN Manager server service must be started and IPC$ must be shared on the server computer using the following commands:

net start server
net share ipc$

The LAN Manager workstation service must also be started on the workstation computer by using the following command:

net start wksta

The server computer name must be specified to ISQL using the -N and -S parameters:

ISQL -Usa -P -N -Sservername

Note that "servername" follows the -S without an intervening space and that leading backslashes are not used. Backslashes are not used when specifying a server name in SAF, SQLTEST(R/P), BCP, or CONSOLE. It is usually a good idea to place the -S parameter last to avoid having the next parameter taken as part of the server name.

If user-level security is active on the server computer (the default), an account must be created on the server computer for each workstation (using NET ADMIN). Furthermore, to connect with SQL Server, each of these accounts must be permitted to use the share name \PIPE (also done with NET ADMIN). LAN Manager is supplied with a default account group name, *USERS. This group is already permitted to use \PIPE; therefore, merely adding an account that is a member of the *USERS group should be sufficient.

In addition, when user-level security is active, the workstation must issue a NET LOGON command before attempting to connect with SQL Server. Many NET commands perform an implicit NET LOGON; therefore, this may not be necessary unless SQL Server access is attempted before other NET commands are issued. When in doubt, use the CONFIG option of the NET command to determine whether or not you are actually logged on (the Logon option is deactivated if you are already logged on).

Note that the pipe name that failed to open is displayed in the error message. If a server name is correctly specified, it will appear in the message as follows:

Open failed on network pipe : \\MYSERVER\PIPE\SQL\QUERY

If the server name (in this case "\\MYSERVER") does not appear in the error message, either the server name was not specified correctly or it was intentionally omitted to indicate that a local named pipe is to be used (ISQL, BCP, CONSOLE, or SQLTESTP only). Local named pipes can be used only when the server and client reside on the same machine. If only local named pipes are used, you do not need to start the LAN Manager server or workstation services SHARE IPC$ and NET LOGON.

Additional query words: dblib connect net logon pipe user-level security

Keywords          : kbprg SSrvDB_Lib SSrvISQL 
Version           : 4.2
Platform          : OS/2 
Issue type        : 

Last Reviewed: April 17, 1999