DATABASELINK TUTORIAL

Dropping Tables with Raw SQL
This feature is not supported on the Wolfram Cloud.

The raw SQL command DROP TABLE drops tables from a database. An alternative is to use the Wolfram Language command SQLDropTable, described in "Dropping Tables".

If you find that the examples in this tutorial do not work as shown, you may need to install or restore the example database with the package, as described in "Using the Example Databases".

When dropping a table, the result of SQLExecute will be $Failed if there is an error.

Here is an example that drops a table. This loads DatabaseLink and connects to the demo database.

In[17]:=
Click for copyable input

A simple table is created and two rows are inserted.

In[19]:=
Click for copyable input
Out[21]=

An SQL statement that drops the TEST table is executed.

In[22]:=
Click for copyable input
Out[22]=

This confirms that the TEST table is no longer in the database.

In[23]:=
Click for copyable input
Out[23]=

This closes the connection.

In[24]:=
Click for copyable input

It should be noted that it is not permitted to drop a table that is referenced by another.