Purpose
Deletes a table in its entirety. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Drop Table table
table is the name of an open table.
Description
The Drop Table statement completely erases the specified table from the computer's disk. The table must already be open.
Note that if a table is based on a pre-existing database or spreadsheet file, the Drop Table statement will delete the original file as well as the component files which make it a table. In other words, a Drop Table operation may have the effect of deleting a file which is used outside of MapInfo Pro.
The Drop Table statement takes effect immediately; no save operation is required. You cannot undo the effect of a Drop Table statement by selecting Revert Table or Undo commands. Similarly, the MapBasic Rollback statement will not undo the effect of a Drop Table statement. You should be extremely cautious when using the Drop Table statement.
The Drop Table statement can also be used to delete a GeoPackage table. Deleting a GeoPackage table deletes the *.tab file and all associated component files. If a GeoPackage has only one table, using this statement will delete only the table and associate files, not the GeoPackage file.
The Drop Table statement cannot be used to delete a table that is actually a "view" For example, a StreetInfo table (such as SF_STRTS) is actually a view, combining two other tables (SF_STRT1 and SF_STRT2). So, you could not delete the SF_STRTS table by using the Drop Table statement.
Example
Open Table "clients"
Drop Table clients
See Also:
Create Table statement, Delete statement, Kill statement