Will NEWSEQUENTIALID () SQL always generate a unique identifier regardless of the host machine?

This is a general request. My scenario: I have a DB (MS SQL) and create a table with a column as uniqueidentifier and assign values ​​using NEWSEQUENTIALID (), I know it will always be a unique identifier. But what if I deploy the same database on three machines (2 machines are transactional databases, and the third is a replication database). In the replication DB, I update the column to not assign a value by itself. From the two transactional databases, I will replicate data to the replication database on a daily basis. NOW QUERY IS whether the IDs created on the two transactional DBs will be unique when I replicate to the replication DB. i.e. are these identifiers created uniquely on any machine? or is it just one car?

+3


source to share


1 answer


Yes, it will still be globally unique.

Take a look at the MSDN page: http://msdn.microsoft.com/en-gb/library/ms189786.aspx



In the Specified Computer section, it refers to the fact that the GUID will be larger than the previous one. Thus, more than the last generated is guaranteed for this machine only. Its uniqueness is global.

+2


source







All Articles