connect to...disconnect

Description

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

Syntax

This syntax is sent to Adaptive 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 Adaptive Server, and does not use CIS. You can specify the arguments in any order. If you do not include arguments, Adaptive 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 Adaptive Server. This syntax does not use CIS:

connect using connect_string

Parameters

server_name

is the server to which a passthrough connection is required.

from ASE

disconnects from the current Adaptive Server.

all

disconnects from all Adaptive Servers.

connection_name

disconnects from the specified connection.

engine_name

connects to the specified engine.

database_name

connects to the specified database.

connection_name

connects to the configured connection.

user_id

connects to the user with this ID.

connection_string

connects using a predetermined connection string.

Examples

Example 1

Establishes a passthrough connection to the server named SYBASE:

connect to SYBASE

Example 2

Disconnects the connected server:

disconnect 

Example 3

Disconnects from all servers:

disconnect all

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

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

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

90

security

connect to

  • 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

See also

Commands create existing table, grant

System procedures sp_addserver, sp_autoconnect, sp_helpserver, sp_passthru, sp_remotesql, sp_serveroption