Error 216

Severity

20

Message text

Attempt to automatically drop temporary table failed.

Explanation

Adaptive Server goes through four phases while processing a query:

  1. Parsing – checks the query to make sure the syntax is correct.

  2. Normalization – resolves the column and table names and generates a query tree.

  3. Compilation – performs optimization and generates a query plan.

  4. Execution – carries out the query plan.

During the first three phases of query processing, Adaptive Server creates two types of temporary tables:

Error 216 occurs when Adaptive Server is unable to drop one of the temporary tables it created, probably caused by an Adaptive Server problem. Error 216 occurs with the following states:

State

Meaning

1

During the re-normalization phase, if Adaptive Server cannot drop a temporary table it created, error 216 occurs with state 1. These are definition-time temporary tables.

2

During the normalization phase, if Adaptive Server cannot drop a temporary table it created during the parsing phase, error 216 occurs with state 2.

3

During an abort of the normalization phase, if Adaptive Server cannot drop a temporary table, error 216 occurs with state 3.

4

When a process is killed, if Adaptive Server fails to clean up temporary tables, error 216 occurs with State 4. These can be definition-time or normal temporary tables.

5

If there is an error during the normalization phase, and Adaptive Server cannot drop a temporary table it created during normalization, error 216 occurs with state 5.

6

Similar to state 5.

7

During recompilation of a lightweight procedure, if Adaptive Server is unable to drop a definition-time temporary table, error 216 occurs with state 7.

9

If there is an error during creation of a temporary view, and Adaptive Server cannot drop a temporary table it created during normalization, error 216 occurs with state 9.

10

When processing nested SQL (for example, nested SQL statements within a Java method), if Adaptive Server cannot drop a temporary table at cleanup, error 216 occurs with state 10.

11

Similar to state 10.

12

When processing client or language cursors, if Adaptive Server cannot drop a temporary table at cleanup, error 216 occurs with state 12.

13

When regenerating a stored procedure during upgrade, if Adaptive Server cannot drop a normalization-time temporary table at cleanup, error 216 occurs with state 13.

14

Similar to state 13, but it applies to definition-time temporary tables.

Action

Temporary tables left behind are not a problem in themselves. However, they do take up space in tempdb, and tempdb may eventually fill up. If you think this is a potential problem, shut down and restart Adaptive Server. This will re-create tempdb and drop all temporary tables.

Error 216 can result from running out of locks. Check the Adaptive Server error log; if the 216 error is preceded by 1204 errors in the log, you may not have enough locks configured. See “Error 1204” for instructions to correct that error.

If error 216 persists, contact Sybase Technical Support.

Versions in which this error is raised

All versions