MSSQL: Primary Key Schema Largely Guid but Sometimes Integer Types...
- by Code Sherpa
OK, this may be a silly question but...
I have inherited a project and am tasked with going over the primary
key relationships.
The project largely uses Guids. I say "largely" because there are examples
where tables use integral types to reflect enumerations. For example,
dbo.MessageFolder has MessageFolderId of type int to reflect
public emum MessageFolderTypes
{
inbox = 1,
sent = 2,
trash = 3,
etc...
}
This happens a lot. There are tables with primary keys of type int which
is unavoidable because of their reliance on enumerations and tables with
primary keys of type Guid which reflect the primary key choice on the part
of the previous programmer.
Should I care that the PK schema is spotty like this? It doesn't feel right
but does it really matter? If this could create a problem, how do I get around it (I really can't move all PKs to type int without serious legwork and I have never heard of enumerations that have guid values)?
Thanks.