Breck Carter has several times posted a procedure for dropping all connections to a database. Here is a modified version of that procedure. It is useful when you need to have exclusive access to a database. -- How to get full control over an ASA server... -- call sa_server_option ( 'disable_connections', 'ON' ); -- call sa_drop_other_connections(); -- ...do your thing -- call sa_server_option ( 'disable_connections', 'OFF' ) -- Attempts to connect will get "ASA Error -99: -- Connections to database have been disabled". call sa_make_object( 'procedure', 'sa_drop_other_connections', 'dbo' ); ALTER PROCEDURE dbo.sa_drop_other_connections () BEGIN DECLARE @this_connection_id INTEGER; DECLARE @other_connection_id INTEGER; DECLARE @conn_ident VARCHAR(200); DECLARE @node_address VARCHAR(100); SET @this_connection_id = connection_property ( 'number' ); SET @other_connection_id = NEXT_CONNECTION ( NULL ); WHILE @other_connection_id IS NOT NULL LOOP SET @node_address = connection_property ( 'NodeAddress', @other_connection_id ); SET @conn_ident = STRING( connection_property ( 'Userid', @other_connection_id ), '-', IF COALESCE ( @node_address, '' ) <> '' THEN STRING ( @node_address, ' - ' ) ELSE '' ENDIF, @other_connection_id ); IF @other_connection_id = @this_connection_id THEN MESSAGE 'Not dropping this connection: ' || @conn_ident TO CLIENT; ELSE MESSAGE 'Dropping other connection: ' || @conn_ident TO CLIENT; EXECUTE IMMEDIATE 'DROP CONNECTION ' || @other_connection_id; END IF; SET @other_connection_id = NEXT_CONNECTION ( @other_connection_id ); END LOOP; END;