Friday, February 10, 2012

AutoNumber PK on Most Tables?

I tend to create a "RecordID" IDENTITY-driven PK on subtables where I think most
people wouldn't because there is no immediate obvious need.
My reasoning is "why not?"...seems like a significant convenience later on when
faced with unexpected situations that require identification of specific
records...and the cost seems minimal.
Comments?
--
PeteCresswellI agree with you. I do the same too, which is to create a PK for all tables.
But one thing that I watch for is to see the query patterns on these tables
so that I can use clustered indexes on them. PK's are automatically created
as clustered (unless the nonclustered is specified). For example, if my
subtable resulted because of normalization, I would rather put a clustered
index on the FK and not on the PK.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"(Pete Cresswell)" <x@.y.z> wrote in message
news:3apnsvcaak4cvco9re9vr7h7tuu06384v9@.4ax.com...
> I tend to create a "RecordID" IDENTITY-driven PK on subtables where I
think most
> people wouldn't because there is no immediate obvious need.
> My reasoning is "why not?"...seems like a significant convenience later
on when
> faced with unexpected situations that require identification of specific
> records...and the cost seems minimal.
> Comments?
> --
> PeteCresswell

No comments:

Post a Comment