From the time I started using databases (Sybase 10, Microsoft SQL Server 6.5), I’d always used identity columns for primary keys in tables. So when I came to my current employer and saw GUIDs all over the place, I wondered if that wasn’t overkill.
I did a bit of searching on the issues, and came up with these links:
- Primary Keys: IDs versus GUIDs (Jeff Atwood of Coding Horror)
- The Cost of GUIDs as Primary Keys
- Identity vs. Uniqueidentifier (Joe Celko discussion thread post)
- What Should I Choose for My Primary Key
The authors of these pieces can reasonably be described as pro-GUID. They are up-front about the drawbacks of their preferred option (performance is a big one). I tried the tip on using NewSequentialId() instead of NewId() (from Jeff Atwood) , but SQL Server Management Studio kept giving me errors when I attempted to update the default value of a table column to use it.