Cannot drop system table.

Abstract: Cannot drop system table.

    Problem:

When I try to delete a table in my database, I get an error message that says:

   Invalid modify request.
   unsuccessful metadata update
   ERASE RDB$RELATIONS failed
   cannot delete system tables.
The table is not a system table. The table does not have a detail table. I have another table in the database that I can drop with no trouble. What's going on?

    Cause:

This error comes up sometimes as a result of migrating from an older version of InterBase. Apparently InterBase thinks your table is a system table, and, as you've discovered, InterBase will not drop system tables.

Run the following query.
  SELECT RDB$RELATION_ID, RDB$RELATION_NAME, RDB$SYSTEM_FLAG
  FROM RDB$RELATIONS
  WHERE RBD$RELATION_NAME = 'mytable.gdb'
(Where "mytable.gdb" is the name of the table you are unable to drop.)

There are two conditions that will make InterBase consider your table to be a system table:
  1. If RDB$SYSTEM_FLAG is greater than 0
  2. If RDB$RELATION_ID is less than 256

    Solution:

Update the system table RDB$RELATION to correct the problem. Which field you update depends on where the problem lies. If RDB$SYSTEM_FLAG is greater than one (condition 1 above), then run the following query
   UPDATE RDB$RELATIONS
   SET RDB$SYSTEM_FLAG = 0
   WHERE RDB$RELATION_NAME = 'mytable.gdb'
If RDB$RELATION_ID is less than 256 (condition 2 above), then run this query
   UPDATE RDB$RELATIONS
   SET RDB$RELATION_ID = 9999
   WHERE RDB$RELATION_NAME = 'mytable.gdb'
After running the appropriate query, you should be able to drop your table.