When you are finished working with a database, you can disconnect from it. SQL 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.
When a database server is started, it assigns a unique connection ID to each new connection to the database server. 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' );
Select a database.
Choose File > Disconnect.
Execute a DISCONNECT statement.
For more information, see DISCONNECT statement [ESQL] [Interactive SQL], and DROP CONNECTION statement.
The following statement shows how to use the DISCONNECT statement to disconnect the current connection, conn1, in Interactive SQL:
DISCONNECT conn1;
The following statement shows how to use DISCONNECT in embedded SQL:
EXEC SQL DISCONNECT :conn-name
Connect to the database as a DBA user.
Use the sa_conn_info system procedure to determine the connection ID of the user you want to disconnect.
Execute a DROP CONNECTION statement.
The following statement drops connection number 4.
DROP CONNECTION 4;