Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Julian_Lee
Frequent Visitor

Lakehouse Pipeline/Notebook Script Not Dropping Tables

I am trying to drop a table from a Lakehouse Pipeline using a Script component. I see from previous Fabric Community messages that this is not possible:

Unfortunately, dropping or truncating tables directly from Azure Synapse Analytics or logic apps is not possible with Microsoft Fabric Lakehouse

But...

you can access Notebooks within your Fabric workspace. Notebooks allow executing code like Python or SQL scripts, including DDL statements for dropping or truncating tables.

 

So I created a Notebook in the my Workspace and joined my Lakehouse to it. Using Spark SQL I successfully dropped one of my tables. This table has a dbo schema.

On trying to delete a second table which had an altered schema, the SQL Drop didn't work. I had changed this table's schema prior to this using a Pipeline script with: Alter Schema X Transfer dbo.table;

 

By the looks of it, Notebook does not take the table's schema into account and just assumes it will be dbo. To get around this I  returned the tables schema to dbo by reversing the Alter Schema operation.

Trying to drop the newly alter dbo schema table, the process failed again. I'm assuming that the action of altering the table's schema to a non-dbo schema and then back to dbo has rendered this table as having a non-recognisable schema/table setup.

 

Is it possible to drop a non-dbo schema table from a Lakehouse using SQL?

1 ACCEPTED SOLUTION
v-nikhilan-msft
Community Support
Community Support

Hi @Julian_Lee 
Thanks for using Fabric Community.
There is a similar thread related to the above scenario:
Solved: Drop table that don't have dbo schema - Microsoft Fabric Community

You cannot delete a lakehouse table using the SQL endpoint. This is not available yet. We can drop the tables which belong to the dbo schema using notebook

However, your suggestion is definitely valuable! We use customer feedback like yours to prioritize future features. The more users who request the ability to customize backgrounds, the higher it moves on our list.

 

Appreciate if you could share the feedback on our Microsoft Fabric Ideas. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

 

I hope this information helps. If you have any further queries please do let us know.

Thanks






View solution in original post

1 REPLY 1
v-nikhilan-msft
Community Support
Community Support

Hi @Julian_Lee 
Thanks for using Fabric Community.
There is a similar thread related to the above scenario:
Solved: Drop table that don't have dbo schema - Microsoft Fabric Community

You cannot delete a lakehouse table using the SQL endpoint. This is not available yet. We can drop the tables which belong to the dbo schema using notebook

However, your suggestion is definitely valuable! We use customer feedback like yours to prioritize future features. The more users who request the ability to customize backgrounds, the higher it moves on our list.

 

Appreciate if you could share the feedback on our Microsoft Fabric Ideas. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.

 

I hope this information helps. If you have any further queries please do let us know.

Thanks






Helpful resources

Announcements
FabricCarousel_June2024

Fabric Monthly Update - June 2024

Check out the June 2024 Fabric update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.