FIX: NEWSEQUENTIALID function generates duplicate GUID after SQL Server 2017 on Linux is restarted

Applies to: SQL Server 2017 Developer LinuxSQL Server 2017 Enterprise on LinuxSQL Server 2017 Enterprise Core on Linux


Assume you use the NEWSEQUENTIALID() function to generate unique GUID for a table in SQL Server 2017 on Linux. After you restart the SQL Server, the NEWSEQUENTIALID() function may generate a GUID that's a duplicate of a previous GUID that's generated by this function. 

More Information

SQL Server on Linux stores the sequential UUID seed in /var/opt/mssql/.system/instance_id and increments it during startup. Take a backup of the instance_id file in case of system failure. If the file is lost, the seed is missing, and the new seed is regenerated. The initial seed generation is based on a random bit pattern and a UUID to avoid collisions. However, the new seed that has to be sequentially ordered may not be sequentially ordered after the seed is lost.


This issue is fixed in the following cumulative update for SQL Server:

       Cumulative update 4 for SQL Server 2017


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Learn about the terminology that Microsoft uses to describe software updates.