March 11, 2003 at 8:28 am
When inserting a row, which usage is better for a primary key, Identity (with @@Identity) or Unique Identifier with (NewID())? And what are the pros and cons of each?
March 11, 2003 at 9:42 am
tough questions, lots of responses.
Basically, identity is simpler, easier IMHO for humans to deal with. Less space. Not unique across servers. Can cause issues in replication.
GUID is harder to use in queries (For people), but unique across servers. More space.
Steve Jones
March 11, 2003 at 10:10 am
Also, take into consideration storage size. INT is 8 bytes where Uniqueidentifier is 16 so makes indexes and references bigger in size.
March 11, 2003 at 11:21 am
Lots of threads on this, I have an article up on why I like uniqueidentifers too.
Andy
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply