Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin 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
Hi all,
we are using a data warehouse for creating dimension tables for reporting. The entries have surrogate keys and it is possible, that existing rows are updated with new data.
During the update, we want to make sure that the surrogate keys of existing records in the dimension table do not change. This would be possible with a merge statement while excluding the surrogate key column, which is not possible in a data warehouse stored procedure (see limitations: T-SQL Surface Area in Fabric Data Warehouse - Microsoft Fabric | Microsoft Learn).
We have a solution in mind which involves creating a temporary table while running the CTE in a stored procedure. However, this seems expensive and development-heavy.
Do you know a good way to manage the updates in this scenario?
Thanks a lot! Kind regards,
Niels
Solved! Go to Solution.
Hi @ObungiNiels
I think you are going in right direction
Using a staging table in Fabric Warehouse allows you to separate the incoming data load from the final updates and inserts into your dimension table, thereby preserving surrogate keys.
2 steps process:
Update Existing Records: Use the staging table to update mutable attributes in the dimension table by matching on the business key, ensuring surrogate keys remain unchanged.
2. Insert New Records: Insert unmatched rows from the staging table into the dimension table, generating new surrogate keys for these records
https://learn.microsoft.com/en-us/fabric/data-warehouse/dimensional-modeling-dimension-tables
Hi @nilendraFabric,
thanks for the confirmation. This is how he implemented it in the end:
In each Stored procecure, we are following these steps.
Our concerns regarding performance remain due to the fact that tables are being created and dropped regularly with this approach. Hoping to see MERGE statements coming in for Fabric warehouses in the future. 🙂
Hi @ObungiNiels,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @ObungiNiels,
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @nilendraFabric for sharing valuable insights.
Could you please confirm if your query has been resolved by the provided solution? If so, please mark it as the solution. This will help other community members solve similar problems faster.
Thank you.
Hi @ObungiNiels
I think you are going in right direction
Using a staging table in Fabric Warehouse allows you to separate the incoming data load from the final updates and inserts into your dimension table, thereby preserving surrogate keys.
2 steps process:
Update Existing Records: Use the staging table to update mutable attributes in the dimension table by matching on the business key, ensuring surrogate keys remain unchanged.
2. Insert New Records: Insert unmatched rows from the staging table into the dimension table, generating new surrogate keys for these records
https://learn.microsoft.com/en-us/fabric/data-warehouse/dimensional-modeling-dimension-tables
Hi @nilendraFabric,
thanks for the confirmation. This is how he implemented it in the end:
In each Stored procecure, we are following these steps.
Our concerns regarding performance remain due to the fact that tables are being created and dropped regularly with this approach. Hoping to see MERGE statements coming in for Fabric warehouses in the future. 🙂
Hi @ObungiNiels,
We appreciate your efforts and are pleased to hear that your issue was resolved. Please mark the helpful response and accept it as the solution. This will assist other community members in resolving similar issues more efficiently.
Thank you.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
5 | |
3 | |
3 | |
3 | |
2 |