Search code examples
azure-synapse

How to Drop a Table In Synapse SQL Database Serverless Pool Builtin


I am trying the following code to drop a table in Azure Synapse

drop dbo.tablename

drop tablename

enter image description here

But I keep on getting errors such as:

Unknown object type 'ts_originationopportunity' used in a CREATE, DROP, or ALTER statement.

Or

Unknown object type 'dbo' used in a CREATE, DROP, or ALTER statement.

enter image description here

Can someone let me know what is the correct syntax to drop a table in Azure Synapse Serverless Builtin Pool please


Solution

  • Please note, Synapse has two types of SQL. One is dedicated SQL Pool and another one is Serverless SQL Pool.

    Dedicated SQL Pools will contain tables & external tables. Where as serverless SQL Pool has only external tables.

    To drop table use syntax as DROP TABLE table_name. To drop external table use syntax as DROP EXTERNAL TABLE table_name

    Below are screenshots of same for better understanding. enter image description here enter image description here