A data type holding a 16-byte GUID. Values from NEWID() are random and cause fragmentation in a clustered index, while NEWSEQUENTIALID() produces values that keep increasing.
Also called GUID.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains uniqueidentifier in context, with comparison tables and the common traps.
Terms in this definition
- Data type
A rule limiting what a column may contain, for example INT for integers, DECIMAL for numbers with fractions or VARCHAR for text of varying length. Which types exist depends on the database product.
- GUID
A 128-bit value that is unique, used for things such as session IDs or the default names given to workspaces.
- VALUES
Returns in DAX the distinct column values, or table rows, still visible after filters are applied, sometimes with an extra blank entry. CALCULATE often takes the result as a table filter.
- NEWID
Returns a random uniqueidentifier. The values are not sequential, so indexes on them become fragmented; it also can't be called from within a user-defined function.
- Index
Speeds up queries that filter on certain columns by keeping those columns sorted, with pointers back to each row; the price is more storage and slower writes.
- NEWSEQUENTIALID
Generates GUIDs, each larger than any previously produced on the same machine since Windows last started, which makes them friendlier to indexes. It can only appear as the DEFAULT for a uniqueidentifier column.