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


Drops a semaphore.

DROP SEMAPHORE [ IF EXISTS ] [ owner.]semaphore-name
  • owner

    The owner of the semaphore. owner can also be specified using an indirect identifier (for example, `[@variable-name]`).

  • semaphore-name

    The name of the semaphore. semaphore-name can also be specified using an indirect identifier (for example, `[@variable-name]`).

  • IF EXISTS clause

    Use this clause to drop a semaphore only if it exists. If a semaphore does not exist and this clause is specified, then nothing happens and no error is returned.


An error is returned to any connection that is waiting to decrement the semaphore.


You must have the DROP ANY MUTEX SEMAPHORE or DROP ANY OBJECT system privilege, or be the owner of the semaphore. For a temporary semaphore, you must be the connection that created the mutex.

Side effects

Automatic commit, but only for permanent semaphores.

  • ANSI/ISO SQL Standard

    Not in the standard.


The following statement drops a semaphore called license_counter:

DROP SEMAPHORE license_counter;