ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-69
DROP TABLE
DROP TABLE
Use DROP TABLE to remove a table from a database, along with all data, indexes,
and dependent views for that table.
The DROP TABLE statement has the following syntax:
table-name
identifies the table to be dropped; table-name can be qualified with the database
name and owner name.
If the statement contains errors, the results can be different than if executed using
SQL Server. See Dropping Multiple Tables.
Examples
The following statement drops three tables from the PERSNL database:
use test_disk01_persnl
drop table employee, job, dept
The tables are registered in the NonStop SQL/MP catalog that is on the PERSNL
subvolume on the disk volume DISK01 on the node TEST.
Dropping Multiple Tables
If you drop multiple tables with one DROP TABLE statement and the statement
contains errors, the results may be different than if the statement were executed using
SQL Server.
Because NonStop SQL/MP does not allow you to drop multiple tables with one
statement, the NonStop ODBC Server translates the DROP TABLE statement to
multiple NonStop SQL/MP DROP TABLE statements. Therefore, even if one of the
statements contains an error, the other statements will be executed and will drop the
specified tables. In SQL Server, if one of the table-name clauses contains an error,
the statement fails and none of the tables are dropped.
Dropping Dependent Views and Indexes
You should drop dependent views and indexes before dropping a table using the
NonStop ODBC Server.
DROP TABLE [ [database.]owner.] table-name
database.. ]
[ , [ [database.]owner. ] table-name ] ...
[ [ database.. ] ]