Looking for some advise on creating a primary key for my Product table, which contains silk-screened shirts.
I would like to create a Primary Key (SKU) that not only uniquely identifies a particular “Finished Good”, but that is self-identifying and allows anyone looking at the SKU to quickly know what components make it up.
r937 had a link to a great article that talked about why AutoNumber PK’s can be dangerous in that that have no tie to a physical record.
That is why creating a Primary Key/SKU that is self-identifying and that relates to a shirt’s 4 main components (i.e. Silk-Screen Design, Shirt Style, Shirt Size, and Shirt Color) seems like a good idea.
My only concern is whether creating a Surrogate PK will bog down my table and/or database because of its size.
I was thinking of a SKU layout like this…
[COLOR=“green”][FONT=“Courier New”]
[B]Design component:
[/B]1000 Rawwr
1001 Nom Nom
1002 Clever Girl
1003 B is for Bacon
[B]Style componenet
[/B]TSM T-Shirt (male)
TSF T-Shirt (female)
LSM Long Sleeve (male)
LSF Long Sleve (female)
SSM Sweatshirt (male)
SSF Sweatshirt (female)
[B]Color component
[/B]01 White
02 Black
03 Blue
04 Forest
[B]Size component
[/B]SM Small
MD Medium
LG Large
XL X-Large
X2 XX-Large
X3 XXX-Large
[B]Finished Good SKU
[/B]1003-TSM-01-XL
Which tells me there is a “B is for Bacon”, Men’s T-Shirt, White, Extra-Large shirt.
[/FONT][/COLOR]
QUESTIONS:
1.) Is that okay by itself?
2.) Should I use an AutoNumber and just index the SKU instead?
3.) For SKU readablility, I want hyphens (-) between the parts. How do I handle that?
TomTees