Shawn Wildermuth's Rants and Raves
Thanks for visiting my blog! See more about me here: About Me
Url: http://www.codinghorror.com/blog/archives/00081…
I was reading this codinghorror.com entry today and thought someone else was advocating Guids as keys when I saw mention of something I hadn’t seen before:
NEWSEQUENTIALID() Function in SQL Server 2005
This function (which is only valid in a columns’s DEFAULT constraint) will make GUIDs that are somewhat sequential which eliminates the biggest complaint of mine (fragmented PK Indexes). It is SQL Server 2005 only, but its a cool feature. To be clear this is how its used:
CREATE TABLE Employee
(EmployeeID uniqueidentifier DEFAULT NEWSEQUENTIALID())
This work by
Shawn Wildermuth
is licensed under a
Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License
. Based on a work at
wildermuth.com.