Hi,
I am building some tables and most of them have a unique 'Serial number' field with type varchar(50). As it is unique for every component it should be the primary key along with Date because I might insert the same component on the same table more than once and I want to record all.
So this is what I have:
sNumber varchar(50) primary key,
Date datetime primary key,
...
...
My question is:
Should I instead add an ID field to the table with auto-increment on? The table would become:
ID int primary key(auto-increment on),
sNumber varchar(50),
Date datetime,
...
...
What would you do?
Thanks!
I am building some tables and most of them have a unique 'Serial number' field with type varchar(50). As it is unique for every component it should be the primary key along with Date because I might insert the same component on the same table more than once and I want to record all.
So this is what I have:
sNumber varchar(50) primary key,
Date datetime primary key,
...
...
My question is:
Should I instead add an ID field to the table with auto-increment on? The table would become:
ID int primary key(auto-increment on),
sNumber varchar(50),
Date datetime,
...
...
What would you do?
Thanks!
