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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
arpost
Post Prodigy
Post Prodigy

Anyone know how to drop and re-create a table while also dropping/keeping the relationships?

Greetings, all. I'm still trying to get used to this new behavior with Fabric semantic models creating logical relationships between tables in the DW. I keep needing to change the tables I've created (DROP/CREATE since Fabric doesn't support ALTER), but the foreign key constraints prevent me from doing so unless I delete them first. However, I don't want to have to keep rebuilding my entire data model every time I need to tweak a table as that turns a quick change into a lengthier one.

 

Anyone have thoughts or a trick to automate this? Driving me crazy.

4 REPLIES 4
frithjof_v
Super User
Super User

It's not answering your question, but please vote for this related idea: https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=746601c5-6ba9-ee11-92bd-6045bdb0416e

 

I think ALTER needs to be supported.

 

Also, I hope someone has an answer to your question, I'm wondering the same thing.

I guess I would try to create a SQL script which first deletes the constraints on the existing table, then deletes the table, then creates the new table, and then creates the constraints (relationships) again.

 

I guess you could do the whole process in one SQL script.

 

(If you need to keep the data from the existing table, then add some logic for that before deleting the table.)

 

Hopefully SQL constraints get automatically translated into semantic model relationships, in the same way that semantic model relationships gets translated into SQL constraints. So, hopefully when creating the constraints in SQL, they will appear as relationships in model view, without the need to do anything in the UI. (I think I remember reading somewhere that they will appear as inactive relationship, however I'm not sure).

 

I haven't tried this, and don't have much experience with data warehouse/SQL, but that would be my first approach if I wanted to do it without using the UI but code only.

I have been using a combination of UI and code to do this so far.

But I really hope alter statement will be possible because I think adding and removing columns is a basic need when working with tables. 

 

https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=746601c5-6ba9-ee11-92bd-6045bdb0416e

Anonymous
Not applicable

Hi @arpost 
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Otherwise, will respond back with the more details and we will try to help.
Thanks

Anonymous
Not applicable

Hi @arpost 
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. Otherwise, will respond back with the more details and we will try to help.
Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

May FBC25 Carousel

Fabric Monthly Update - May 2025

Check out the May 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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