Wednesday, March 7, 2012

DateTime as Primary Key

I've seen using integer or uniqueidentifier as primary key.
But is it good or bad to use DateTime column as primary key?
And why?
ThanksIf you insert multiple records simultaneously, they may all end up with the same datetime value.

...and there goes your unique primary key...|||actually, the unique primary key doesn't go anywhere

it's the multiple inserts that will go away (i.e. be rejected)

:) :) :)|||And you'll create potential hotspots

No comments:

Post a Comment