Removes a table definition and all of its data, indexes, partition properties, triggers, encryption properties, and permissions from the database.
drop table [[database.]owner.]table_name [, [[database.]owner.]table_name] ...
drop table roysched
When you use drop table, any rules or defaults on the table lose their binding, and any triggers associated with it are automatically dropped. If you re-create a table, you must rebind the appropriate rules and defaults and re-create any triggers.
When you drop a table, any partition condition associated with the table is also dropped.
Dropping a table drops any decrypt default associated with the table’s columns, and drops the columns’ encryption properties.
The system tables affected when a table is dropped are sysobjects, syscolumns, sysindexes, sysprotects, syscomments, syspartitions, syspartitionkeys, and sysprocedures.
If CIS is enabled, and if the table being dropped was created with create existing table, the table is not dropped from the remote server. Instead, the SAP ASE server removes references to the table from the system tables.
See also sp_depends, sp_help, sp_spaceused in Reference Manual: Procedures.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for drop table differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be the table owner or a user with drop any table privilege. |
Disabled | With granular permissions disabled, you must be the table owner or a user with sa_role. |
Values in event and extrainfo columns of sysaudits are:
Information | Values |
---|---|
Event | 27 |
Audit option | drop |
Command or access audited | drop table |
Information in extrainfo |
|