I'm using newsequentialid to generate GUIDs for my primary key in a table.
According to the documentation (https://learn.microsoft.com/en-us/sql/t-sql/functions/newsequentialid-transact-sql?view=sql-server-ver15), Sequential GUIDs aren't guarantined to be generated in order.
After restarting Windows, the GUID can start again from a lower range, but is still globally unique
Basically, they're in order until you reboot the machine.
For autoincrement primary key, it makes sense for it to be the clustered index cause it's guaranteed an inserted row will be at the end.
For a GUID primary key, it doesn't make sense for it to be the clustered index cause it's random it's unlikely an inserted row will be at the end.
What about for a sequential GUID primary key? Should the primary key be the clustered index or should I try to find another column like a DateCreated field? The problem is fields like DateCreated isn't going to be a unique field. If I don't have any fields that are unique fields, what should I make as the clustered index?
Sequential GUIDs are much safer for clustered indexes than non-sequential GUIDs. In general, databases are not restarted particularly often. It is true that restarting can result in page splits and fragmentation, but that is usually not too big a consideration because restarting is rare.
That said, the primary key does not need to be the clustered index key. You can have an identity
column or creation date/time as the clustered index, pretty much eliminating this issue.