Forum Discussion
Generating Unique Keys in Fabric Data Warehouse
- Anonymous1 year ago
Hi Anonymous ,
Thank you for your follow-up.
Seems you are facing duplicate values when generating unique identifiers using NEWID() and GETDATE().
GETDATE() has limited precision (3 milliseconds), which can lead to duplicate values when multiple rows are inserted in quick succession.Instead of GETDATE(), you may use SYSDATETIME() because it has higher precision (up to 7 decimal places for seconds), reducing the chances of duplicates.
Refer the link for detailed understanding.
If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you for being a part of the Microsoft Fabric Community Forum!
Hi Pallavi,
Thanks for the reply. But GUID isnt supported in Microsoft Fabric Data warehouse.
In this Microsoft's article Generate-Unique-Identifiers tells us to use NEWID() along with date to get unique values. But in our case even after using this combination we get duplicate values.
Best Regards,
Hari
- Anonymous1 year agoNot applicable
Hi Anonymous ,
Thank you for your follow-up.
Seems you are facing duplicate values when generating unique identifiers using NEWID() and GETDATE().
GETDATE() has limited precision (3 milliseconds), which can lead to duplicate values when multiple rows are inserted in quick succession.Instead of GETDATE(), you may use SYSDATETIME() because it has higher precision (up to 7 decimal places for seconds), reducing the chances of duplicates.
Refer the link for detailed understanding.
If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you for being a part of the Microsoft Fabric Community Forum!