Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Generating Unique Keys in Fabric Data Warehouse

Hi All,   This is my first time posting in a forum. Please apologize me in case if I make some mistakes.   We have a huge dataset, and we are planning to generate unique identifiers in a warehous...
  • Anonymous's avatar
    Anonymous
    1 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!