Connects to the specified server to establish a passthrough-mode connection; takes the connection out of passthrough mode.
connect to server_name disconnect
connect to specifies the server to which a passthrough connection is required. Passthrough mode enables you to perform native operations on a remote server.
server_name must be the name of a server in the sysservers table, with its server class and network name defined.
When establishing a connection to server_name on behalf of the user, Component Integration Services uses one of the following identifiers:
- A remote login alias described in sysattributes, if present
- The user’s name and passwordIn either case, if the connection cannot be made to the specified server, Adaptive Server returns an error message.
For more information about adding remote servers, see sp_addserver.
After making a passthrough connection, Component Integration Services bypasses the Transact-SQL parser and compiler when subsequent language text is received. It passes statements directly to the specified server, and converts the results into a form that can be recognized by the Open Client interface and returned to the client program.
To take the connection created by the connect to command out of passthrough mode, use the disconnect command. You can use this command only after the connection has been made using connect to.
disconnect does not actually cause the termination of the connection to the remote server; instead, it simply takes the connection out of passthrough mode, leaving the connection available for subsequent DDL or DML statements that are processed normally by the ASE query processor.
The disconnect command can be abbreviated to disc.
The disconnect command returns an error unless connect to has been previously issued and the server is connected to a remote server.
When the disconnect command is issued, CIS will forward the disconnect command to the remote server, to take it out of passthrough mode. If not in passthrough mode, syntax errors may occur, but they are ignored by CIS and not forwarded to the client.
No interaction occurs with ASAnywhere when the connect or disconnect commands are issued.
No interaction occurs with ASIQ when the connect or disconnect commands are issued.
No interaction occurs with sql_server when the connect or disconnect commands are issued.
When the connect command is issued using a server in class direct_connect, the direct_connect is sent an RPC:
sp_thread_props “passthru mode”, 1
When the disconnect command is issued, and the server for which a passthrough-mode connection has been established is a direct_connect, the direct_connect is sent an RPC:
sp_thread_props “passthru mode”, 0
No interaction occurs with db2 when the connect or disconnect commands are issued.
commit in the Adaptive Server Reference Manual.