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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
frithjof_v
Community Champion
Community Champion

SQL Analytics Endpoint - Table constraints disappear after running Dataflow Gen2

Hi,

 

I created a Lakehouse with 2 tables:

 

Fact table: RandomNumbers

Dimensions table: Dim_Date

 

I created a relationship between the tables in the SQL Analytics Endpoint

 

frithjof_v_2-1713645285080.png

frithjof_v_3-1713645298521.png

 

When I query the [INFORMATION_SCHEMA].[TABLE_CONSTRAINTS] view, I can see that these relationships have been registered as constraints on the tables in the SQL Analytics Endpoint.

 

frithjof_v_1-1713685977271.png

 

When I connect to the RandomNumbers table of the SQL Analytics Endpoint from Power Query in Power BI Desktop, I can see that there is an expandable column so I can easily expand columns from Dim_Date into the RandomNumbers query.

 

frithjof_v_0-1713685765937.png

 

 

 

I have a Dataflow Gen2 which, when it runs, does a Replace with Dynamic schema of the Dim_Date table.

 

After running the Dataflow Gen2, these are my observations:

 

  • The relationship still appears in the model pane of the SQL Analytics Endpoint ✔️
  • The relationship still works in the Default Direct Lake semantic model ✔️
  • The constraints are not found anymore when I query the [INFORMATION_SCHEMA].[TABLE_CONSTRAINTS] view 
  • The expandable column is not found anymore in Power Query in Power BI Desktop. An import mode semantic model I built which uses this expandable column, get failed refreshes because the column can't be found anymore.  

 

My questions:

- Is this the expected behavior?

- Shouldn't the table constraints and the model relationships in the SQL Analytics Endpoint be automatically synchronized?

 

 

Thank you! 😀

1 ACCEPTED SOLUTION
frithjof_v
Community Champion
Community Champion

Oh, I see... My bad. It's not regular Replace I am using. I am actually using Replace with Dynamic schema. I had forgotten that. (I now changed the info to Replace with Dynamic schema also in my previous comments)

I guess the Dynamic schema setting is causing the table to get dropped and recreated.


I still find it inconsistent that the constraints and model relationships are affected differently by this operation. 

 

However, for my use, the model relationships are more important than the table constraints. So I like that the model relationships are not being dropped at least.

 

I just need to beware not to use the expand column option in Power Query for my import mode semantic models, when working with lakehouse tables which are subject to Dynamic schema.
As the expand column option seems to be depending on the table constraints in the SQL Analytics Endpoint, and the table constraints don't seem to get recreated when the table gets dropped and recreated.

 

I would prefer that the table constraints also keep working after running a Dataflow Gen2 with Dynamic schema, similar like the model relationships. 

 

frithjof_v_0-1713706166102.png

 

View solution in original post

5 REPLIES 5
frithjof_v
Community Champion
Community Champion

Oh, I see... My bad. It's not regular Replace I am using. I am actually using Replace with Dynamic schema. I had forgotten that. (I now changed the info to Replace with Dynamic schema also in my previous comments)

I guess the Dynamic schema setting is causing the table to get dropped and recreated.


I still find it inconsistent that the constraints and model relationships are affected differently by this operation. 

 

However, for my use, the model relationships are more important than the table constraints. So I like that the model relationships are not being dropped at least.

 

I just need to beware not to use the expand column option in Power Query for my import mode semantic models, when working with lakehouse tables which are subject to Dynamic schema.
As the expand column option seems to be depending on the table constraints in the SQL Analytics Endpoint, and the table constraints don't seem to get recreated when the table gets dropped and recreated.

 

I would prefer that the table constraints also keep working after running a Dataflow Gen2 with Dynamic schema, similar like the model relationships. 

 

frithjof_v_0-1713706166102.png

 

Hi @frithjof_v 
Apologies for the issue you have been facing. Thanks for the feedback. I have forwarded the feedback to the internal team.
Hope this helps. Please let me know if you have any further queries. Glad to help.

frithjof_v
Community Champion
Community Champion

I am suspecting that the reason is that the Dataflow Gen2 drops and recreates the Lakehouse table when using Replace mode with Dynamic schema.

 

So maybe that's why the constraints are removed (or rather: not re-applied) from the tables in the SQL Analytics Endpoint?

 

However, I think it's not consistent with the model relationships still being present and working afterwards.

 

 

These are the destination settings in my Dataflow Gen2:

 

 

frithjof_v_0-1713705197318.png

 

AndyDDC
Most Valuable Professional
Most Valuable Professional

Just a quick one before I dive a little deeper, this is a Warehouse (and not a Lakehouse)?

It's a Lakehouse

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors