locked
How Unique is uniqueidentifier RRS feed

  • Question

  • Hi,

    I have SQL Server in 5 sites and I have a server in the 6th Site. If I have transaction_guid with uniqueidentifier datatype, will it be unique if I get it from every site? I mean if the transaction_guid came from site 1 then is it possible that it will be same generated from another site or that's IMPOSSIBLE?

    Thanks,

    Jassim

    Tuesday, October 11, 2016 11:24 PM

Answers

  • Yes, it is guaranteed to be unique. It is generated based on your MAC address of your NIC.

    https://technet.microsoft.com/en-us/library/ms190215%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396

    • Marked as answer by Jassim Rahma Wednesday, October 12, 2016 11:38 AM
    Tuesday, October 11, 2016 11:57 PM

All replies

  • Yes, it is guaranteed to be unique. It is generated based on your MAC address of your NIC.

    https://technet.microsoft.com/en-us/library/ms190215%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396

    • Marked as answer by Jassim Rahma Wednesday, October 12, 2016 11:38 AM
    Tuesday, October 11, 2016 11:57 PM
  • ... any if you ever get to see duplicates, you should go and play in casino and use your luck there.

    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog | Team Blog | @Twitter | Facebook
    Author: SQL Server 2012 AlwaysOn - Paperback, Kindle

    Wednesday, October 12, 2016 12:56 AM
  • then in my scenario, do you recommend to use uniqueidentifier as transaction_id or I should use an int which is the primary key (auto increment).
    Wednesday, October 12, 2016 11:42 AM