connect to...disconnect

Description

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

Syntax

Syntax 1 This syntax is sent to Adaptive Server verbatim. Use this syntax with Component Integration Services (CIS) to create a passthru to a different server.

connect to server_name
disconnect
	[from ASE]
	[all]
	[connection_name]

Syntax 2 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 an 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]]]

Syntax 3 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

connect to the specified engine.

database_name

connects to the specified database.

connection_name

connect to the configured connection.

user_id

connect to the user with this ID.

connection_string

connects using a predetermine 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 in effect

See also

Commands create existing table, grant

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