Some users may always require a passthrough connection to a given server. If this is the case, Component Integration Services can be configured so that it automatically connects these users to a specified remote server in passthrough mode when the users connect to the server. This feature is enabled and disabled by the system procedure sp_autoconnect using the following syntax:

sp_autoconnect server_name, true|false [,loginname]

Before using sp_autoconnect, add the server_name to sysservers by using sp_addserver.

A user can request automatic connection to a server using sp_autoconnect, but only the System Administrator can enable or disable automatic passthrough connection for another user. Thus, only the System Administrator can specify a third argument to this procedure.

If the second argument is true, the autoconnect feature is enabled for the current user (or the user specified in the third argument). If the second argument is false, the autoconnect feature is disabled.

Anytime a user connects to the server, that user’s autoconnect status in syslogins is checked. If enabled, the server_name, also found in syslogins (placed there by sp_autoconnect), is checked for validity. If the server is valid, the user is automatically connected to that server, and a passthrough status is established. Subsequent language statements received by the server from this user are handled exactly as if the user explicitly entered the connect command. This user then views the server very much like a passthrough gateway to the remote server.

When an “autoconnected” user executes a disconnect, she or he is returned normally to the server.

If the remote server cannot be reached, the user (unless the user is assigned the “sa” role) will not be connected to the local Adaptive Server. A “login failed” error message is returned.