Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
DROP EXTERNAL TABLE (Transact-SQL)
Applies to: 👁 Image
SQL Server 2016 (13.x) and later versions 👁 Image
Azure SQL Database 👁 Image
Azure SQL Managed Instance 👁 Image
Azure Synapse Analytics 👁 Image
Analytics Platform System (PDW) 👁 Image
Warehouse in Microsoft Fabric
Removes an external table from a database, but doesn't delete the external data.
👁 Image
Transact-SQL syntax conventions
Syntax
DROP EXTERNAL TABLE { database_name.schema_name.table_name | schema_name.table_name | table_name }
[;]
Arguments
[ database_name . [schema_name] . | schema_name . ] table_name
The one- to three-part name of the external table to remove. The table name can optionally include the schema, or the database and schema.
Permissions
Requires:
- ALTER permission on the schema to which the table belongs.
- ALTER ANY EXTERNAL DATA SOURCE
- ALTER ANY EXTERNAL FILE FORMAT
Remarks
Dropping an external table removes all table-related metadata. It doesn't delete the external data.
Examples
A. Use basic syntax
DROP EXTERNAL TABLE SalesPerson;
DROP EXTERNAL TABLE dbo.SalesPerson;
DROP EXTERNAL TABLE EasternDivision.dbo.SalesPerson;
B. Drop an external table from the current database
The following example removes the ProductVendor1 table, its data, indexes, and any dependent views from the current database.
DROP EXTERNAL TABLE ProductVendor1;
C. Drop a table from another database
The following example drops the SalesPerson table in the EasternDivision database.
DROP EXTERNAL TABLE EasternDivision.dbo.SalesPerson;
Related content
Feedback
Was this page helpful?
