Contents Index Erasing a database Setting properties for database objects

ASA SQL User's Guide
  Working with Database Objects
    Working with databases

Disconnecting from a database


When you are finished working with a database, you can disconnect from it. Adaptive Server Anywhere also gives you the ability to disconnect other users from a given database; for more information about doing this in Sybase Central, see Managing connected users.

You can obtain a user's connection-id using the connection_property function to request the connection number. The following statement returns the connection ID of the current connection:

SELECT connection_property( 'number' )

To disconnect from a database (Sybase Central)

  1. Select a database.

  2. Choose Tools > Disconnect.

To disconnect from a database (SQL)

Example 1 

The following statement shows how to use DISCONNECT from Interactive SQL to disconnect all connections:

DISCONNECT ALL
Example 2 

The following statement shows how to use DISCONNECT in Embedded SQL:

EXEC SQL DISCONNECT :conn_name

To disconnect other users from a database (SQL)

  1. Connect to an existing database with DBA authority.

  2. Execute a DROP CONNECTION statement.

Example 

The following statement drops the connection with ID number 4.

DROP CONNECTION 4

For more information, see DISCONNECT statement [ESQL] [Interactive SQL], and DROP CONNECTION statement.


Contents Index Erasing a database Setting properties for database objects