<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4628279#M2803</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Fabric Community,&lt;BR /&gt;&lt;BR /&gt;While implementing a Slowly Changing Dimension (SCD) Type 2 pattern in &lt;STRONG&gt;Microsoft Fabric Warehouse (T-SQL)&lt;/STRONG&gt;, I ran into a key limitation I wanted to share:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Fabric Warehouse does not support IDENTITY or SEQUENCE&lt;/STRONG&gt; for auto-generating surrogate keys.&lt;BR /&gt;&lt;BR /&gt;This poses a challenge when building dimension tables where each version of a business entity (e.g., an employee) needs a unique surrogate key — especially in SCD Type 2 scenarios where multiple versions of a record exist.&lt;BR /&gt;&lt;BR /&gt;I attempted the following:&lt;BR /&gt;• IDENTITY – not supported in Fabric Warehouse&lt;BR /&gt;• CREATE SEQUENCE – not supported either&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Questions for the community:&lt;/STRONG&gt;&lt;BR /&gt;1. Are there any recommended best practices for surrogate key generation in Fabric Warehouse?&lt;BR /&gt;2. Is support for SEQUENCE or IDENTITY on the roadmap?&lt;BR /&gt;3. How are others handling surrogate key generation for SCD or fact table loads in the Warehouse environment?&lt;BR /&gt;&lt;BR /&gt;Looking forward to your thoughts and suggestions!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Mar 2025 21:14:13 GMT</pubDate>
    <dc:creator>FabricLearner</dc:creator>
    <dc:date>2025-03-27T21:14:13Z</dc:date>
    <item>
      <title>Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4628279#M2803</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Fabric Community,&lt;BR /&gt;&lt;BR /&gt;While implementing a Slowly Changing Dimension (SCD) Type 2 pattern in &lt;STRONG&gt;Microsoft Fabric Warehouse (T-SQL)&lt;/STRONG&gt;, I ran into a key limitation I wanted to share:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Fabric Warehouse does not support IDENTITY or SEQUENCE&lt;/STRONG&gt; for auto-generating surrogate keys.&lt;BR /&gt;&lt;BR /&gt;This poses a challenge when building dimension tables where each version of a business entity (e.g., an employee) needs a unique surrogate key — especially in SCD Type 2 scenarios where multiple versions of a record exist.&lt;BR /&gt;&lt;BR /&gt;I attempted the following:&lt;BR /&gt;• IDENTITY – not supported in Fabric Warehouse&lt;BR /&gt;• CREATE SEQUENCE – not supported either&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Questions for the community:&lt;/STRONG&gt;&lt;BR /&gt;1. Are there any recommended best practices for surrogate key generation in Fabric Warehouse?&lt;BR /&gt;2. Is support for SEQUENCE or IDENTITY on the roadmap?&lt;BR /&gt;3. How are others handling surrogate key generation for SCD or fact table loads in the Warehouse environment?&lt;BR /&gt;&lt;BR /&gt;Looking forward to your thoughts and suggestions!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 21:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4628279#M2803</guid>
      <dc:creator>FabricLearner</dc:creator>
      <dc:date>2025-03-27T21:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4628391#M2804</link>
      <description>&lt;DIV class="" data-heading-level="h2"&gt;
&lt;H2 class=""&gt;Table constraints&lt;/H2&gt;
&lt;P&gt;SQL analytics endpoint and Warehouse in Microsoft Fabric support these table constraints:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PRIMARY KEY is only supported when NONCLUSTERED and NOT ENFORCED are both used.&lt;/LI&gt;
&lt;LI&gt;FOREIGN KEY is only supported when NOT ENFORCED is used.&lt;/LI&gt;
&lt;LI&gt;UNIQUE constraint is only supported when NONCLUSTERED and NOT ENFORCED are both used.
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/table-constraints" target="_blank" rel="noopener"&gt;Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Mar 2025 00:18:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4628391#M2804</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-28T00:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4629195#M2806</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="747649" data-lia-user-login="FabricLearner" class="lia-mention lia-mention-user"&gt;FabricLearner&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thank you for posting in the Microsoft Fabric Community. Also thankyou&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp; for your inputs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Microsoft Fabric Warehouse currently does not support IDENTITY or SEQUENCE for auto-generating surrogate keys, which presents challenges when implementing Slowly Changing Dimension (SCD) Type 2 patterns or managing fact table loads.&lt;/P&gt;
&lt;P&gt;However, there are alternative approaches to handle surrogate key generation effectively. One recommended approach is to use ROW_NUMBER (), which generates unique keys dynamically during batch inserts, though it does not persist across multiple sessions. Another approach is to maintain a key generation table, which tracks and increments key values manually to simulate the behavior of an identity column.&lt;/P&gt;
&lt;P&gt;Additionally, using hash-based surrogate keys, where a combination of business keys and timestamps is hashed, can ensure uniqueness in SCD Type 2 scenarios.&lt;/P&gt;
&lt;P&gt;For more details on managing unique identifiers in Fabric Warehouse, refer to the official Microsoft documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/generate-unique-identifiers" target="_blank" rel="noopener"&gt;Generate unique identifiers in a warehouse table - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-warehouse/table-constraints" target="_blank" rel="noopener"&gt;Primary, foreign, and unique keys - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope my suggestion help you to get an idea, if you need any further assistance, feel free to reach out.&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please give us Kudos and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thankyou.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 11:57:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4629195#M2806</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-28T11:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4631914#M2814</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="747649" data-lia-user-login="FabricLearner" class="lia-mention lia-mention-user"&gt;FabricLearner&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 17:12:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4631914#M2814</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-31T17:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4633562#M2826</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I've successfully generated unique identifiers for the surrigate key&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;using the&amp;nbsp;&lt;/SPAN&gt;NEWID()&lt;SPAN&gt;&amp;nbsp;function. This ensures that each row has a distinct identifier, enhancing data integrity and uniqueness.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 14:44:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4633562#M2826</guid>
      <dc:creator>FabricLearner</dc:creator>
      <dc:date>2025-04-01T14:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4634609#M2832</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="747649" data-lia-user-login="FabricLearner" class="lia-mention lia-mention-user"&gt;FabricLearner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that NEWID() worked for generating unique surrogate keys! It’s a reliable way to ensure uniqueness, but there are some considerations to keep in mind. Since NEWID() generates 16-byte GUIDs, it can lead to larger storage requirements and potential indexing inefficiencies compared to integer-based keys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally, because GUIDs are randomly distributed, they may cause index fragmentation, which can impact query performance over time. If performance becomes a concern, alternative approaches such as using ROW_NUMBER() during batch processing or maintaining a key-tracking table to simulate an identity column could be more efficient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is hash-based keys, where a combination of business keys and timestamps is hashed to maintain uniqueness while keeping storage overhead lower. It would be interesting to hear if you’ve noticed any performance implications with NEWID() so far and how it’s working in your specific use case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please give us Kudos and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thankyou.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 08:35:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4634609#M2832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-02T08:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4640116#M2851</link>
      <description>&lt;P&gt;&lt;SPAN data-teams="true"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="747649" data-lia-user-login="FabricLearner" class="lia-mention lia-mention-user"&gt;FabricLearner&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;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.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 02:24:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4640116#M2851</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-07T02:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Surrogate Key Limitation in Fabric Warehouse - No support for SEQUENCE or IDENTITY</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4647803#M2879</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="747649" data-lia-user-login="FabricLearner" class="lia-mention lia-mention-user"&gt;FabricLearner&lt;/a&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Apr 2025 00:37:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Surrogate-Key-Limitation-in-Fabric-Warehouse-No-support-for/m-p/4647803#M2879</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-11T00:37:57Z</dc:date>
    </item>
  </channel>
</rss>

