3 ms·
Word of caution to anybody looking to use a similar method working with SQL Server: the SQL Server uniqueidentifier type is stored differently on disk than bina
by lazulicurio 10y ago
Word of caution to anybody looking to use a similar method working with SQL Server: the SQL Server uniqueidentifier type is stored differently on disk than binary(16). Instead of being ordered by bytes 0-1-2-3-4-5-6-7-8-9-10-11-12-13-14-15, uniqueidentifier values are ordered by bytes 10-11-12-13-14-15-8-9-7-6-5-4-3-2-1.
- zamalek 10y agoMSSQL does have a similar identifier, though - NEWSEQUENTIALID.
- lazulicurio 10y agoYes, but NEWSEQUENTIALID isn't globally ordered, it's only ordered for the computer on which it was generated. For that matter, on a single computer the ordering isn't guaranteed[1]. This makes NEWSEQUENTIALID fairly useless if you're looking to merge records from disparate sources and sort them independently of origin. [1] https://connect.microsoft.com/SQLServer/feedback/details/475131/newsequentialid-is-not-sequential https://connect.microsoft.com/SQLServer/feedback/details/475...
- zamalek 10y agoAh right, I stand corrected.