Primary key

Liat

New member
Local time
Today, 00:10
Joined
Oct 27, 2005
Messages
6
Is it important that primary key would be a number for performance purposes?
How do I set 2 different fields as one primary key?
How do I set 2 different fields as two separate primary keys?
 
Liat said:
Is it important that primary key would be a number for performance purposes?

It's best as it's easier to index numbers rather than text due to the size taken up.

How do I set 2 different fields as one primary key?

Select them both, right click, set primary key.

How do I set 2 different fields as two separate primary keys?
A table can only have one primary key consisting of up to, I believe, ten fields.
 
Although a table can have only one primary key (comprised of up to 10 columns), it may have many indexes some of which might be unique. So for example, if you are interfacing with a legacy application and you are getting "CustomerNumber" from them but you prefer to use an autonumber as the primary key for your tables, you can assign a unique index for CustomerNumber to prevent duplicates. You might also have a second unique index on CustomerName, again to prevent duplicates.
 

Users who are viewing this thread

Back
Top Bottom