How to delete a table in Azure Synapse Dedicated Pool from a Synapse Spark notebook

Jimmy Dobbins 21 Reputation points Microsoft Employee
2024-04-10T19:47:22.7+00:00

I have a notebook that loads several tables in Azure Synapse Dedicated pool. I am using the Apache Spark connector for Synapse dedicated pools. I am using mode("overwrite"), but this does not drop the target table. I need to do something similar to "drop table if exists stg.customer" before loading from a dataframe in the notebook. I have tried everything I can think of, including a stored procedure, but nothing works. Any advice is greatly appreciated! A screenshot of my cell and what I have tried follows (note that the procedure works if I run it from a SQL script, but the table remains even after this cell runs successfully...nothing really happened):

User's image

Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.


2 answers

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.