Component Integration Services only – Connects to the specified server and disconnects the connected server.
connect to server_name disconnect
is the server to which a passthrough connection is required.
Establishes a passthrough connection to the server named SYBASE:
connect to SYBASE
Disconnects the connected server:
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 password
In 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 close the connection created by the connect to command, use the disconnect command. You can use this command only after the connection has been made using connect to.
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.
SQL92 – Compliance level: Transact-SQL extension.
Permission to use the connect to command must be explicitly granted by the System Administrator. The syntax is:
grant connect to user_name
The System Administrator can grant or revoke connect permission to public globally while in the master database. If the System Administrator wants to grant or revoke connect to permission for a particular user, the user must be a valid user of the master database, and the System Administrator must first revoke permission from public as follows:
use master go revoke connect from public go sp_adduser fred go grant connect to fred go
Commands create existing table, grant
System procedures sp_addserver, sp_autoconnect, sp_helpserver, sp_passthru, sp_remotesql, sp_serveroption