connect to...disconnect

(Component Integration Services only) Connects to the specified server and disconnects the connected server.

Syntax

This syntax is sent to the SAP ASE server verbatim. Use this syntax with CIS to create a passthru to a different server:
connect to server_name
disconnect
	[from ASE]
	[all]
	[connection_name]
This syntax opens a new JDBC-level connection to the SAP ASE server, and does not use CIS. You can specify the arguments in any order. If you do not include arguments, the SAP ASE server prompts you for connection parameters:
connect
	[to ASE engine_name]
	[database database_name]
	[as connection_name]
	[user user_id]
	[identified by password]]]
This syntax opens a new JDBC-level connection to the SAP ASE server. This syntax does not use CIS:
connect using connect_string

Parameters

Examples

Usage

  • 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, CIS 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, the SAP ASE server returns an error message.

  • After making a passthrough connection, CIS 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.

  • You can abbreviate the disconnect command to disc.

  • The disconnect command returns an error unless connect to has been previously issued and the server is connected to a remote server.

See also sp_addserver, sp_autoconnect, sp_helpserver, sp_passthru, sp_remotesql, sp_serveroption in Reference Manual: Procedures.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

You must have the connect privilege to use the connect to command..

Auditing

Values in event and extrainfo columns of sysaudits are:

InformationValues
Event

90

Audit option

security

Command or access audited

connect to

Information in extrainfo
  • Roles – current active roles

  • Keywords or optionsconnect to

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if set proxy is in effect

Related reference
create existing table
grant