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

Fabric Data Days Monthly is back. Join us on March 26th for two expert-led sessions on 1) Getting Started with Fabric IQ and 2) Mapping & Spacial Analytics in Fabric. Register now

Reply
VirajD
Regular Visitor

IDENTITY column for generation of Surrogate keys in Fabric Warehouse

Hi,

 Since Fabric Warehouse does not support the IDENTITY functionality on a column for Surrogate key generation, is anyone aware of any alternate practical method to generate surrogate keys apart from the NEWID() function and MAXID + ROW_NUMBER() approach ?

 

 

1 ACCEPTED SOLUTION
DataBard
Most Valuable Professional
Most Valuable Professional

Hi @VirajD ,

One other approach I've seen used in Fabric is creating a hash of your data and using that as a surrogate key. 

 

For example if you have a PersonID, you could do this:

HASHBYTES('SHA2_256', CONVERT(varchar(800), PersonID))

Depending on your definition, it's not a surrogate key because it's derived from your existing data.

 

If this isn't a viable option, I haven't seen any alternatives to date beyond the ones you've ruled out. You'd likely need to either build your own solution to create a surrogate or otherwise find another option.

View solution in original post

4 REPLIES 4
payyan_s
New Member

Not making much sense to me. The identity column is giving protection and feasibility to the user to update any other column values without creating duplicates. When you use haskey, will it not change when the underlying data is changed and lead to potential duplicate values?

v-prasare
Community Support
Community Support

Hi @VirajD,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

The solution provided is accepted.

DataBard
Most Valuable Professional
Most Valuable Professional

Hi @VirajD ,

One other approach I've seen used in Fabric is creating a hash of your data and using that as a surrogate key. 

 

For example if you have a PersonID, you could do this:

HASHBYTES('SHA2_256', CONVERT(varchar(800), PersonID))

Depending on your definition, it's not a surrogate key because it's derived from your existing data.

 

If this isn't a viable option, I haven't seen any alternatives to date beyond the ones you've ruled out. You'd likely need to either build your own solution to create a surrogate or otherwise find another option.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Fabric Update Carousel

Fabric Monthly Update - February 2026

Check out the February 2026 Fabric update to learn about new features.