Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - SQL Reference » SQL statements » Alphabetical list of SQL statements

STOP SERVER statement

Stops a database server.

STOP SERVER [ database-server-name ] [ UNCONDITIONALLY ]

    If you are the only connection to the database server, you do not need to use UNCONDITIONALLY. If there are other connections, the database server stops only if you use the UNCONDITIONALLY keyword.


You can only use database-server-name in Interactive SQL only. If you do not execute this statement from Interactive SQL, the current database server is stopped.

By default, the database server is not stopped if there are other connections to it. If the UNCONDITIONALLY clause is used, the database server is stopped even if there are other connections to the database server. If the STOP SERVER statement is executed on a client connection and the server successfully shuts down, a communication error occurs.

If you want the database server to ignore certain connections when determining whether or not to shut down the database, then you can use the connection_type option.

The STOP SERVER statement cannot be used in stored procedures, triggers, events, or batches.

STOP ENGINE is accepted for compatibility reasons, but is deprecated.


The privileges to shut down a network server (dbsrv17) depend on the -gk setting on the database server command line. By default, the SERVER OPERATOR privilege is required to shut down a network server.

Side effects


  • ANSI/ISO SQL Standard

    Not in the standard.


Stop the current database server, as long as there are no other connections.