why chose a primary key?

G

Guest

I have an existing database that I did not chose to have a primary key for.
What would be the reason to have a primary key?

Also, if I need to create a new table to hold other information, would this
be a reason to have a primary key - then create a relationship with my
existing table?

Thanks, Rachel
 
J

John W. Vinson

I have an existing database that I did not chose to have a primary key for.
What would be the reason to have a primary key?

If you need to be able to UNIQUELY identify a record - say, to delete it or
update it using a query - then a primary key is essential. Otherwise you could
have two or more records which are identical in every field, exact duplicates.

Don't fall for Microsoft's implication that a Primary Key must be an
Autonumber. It needn't be. If you have some "natural" key, a field or
combination of fields which usinquely identfy the record, then by all means
use that.
Also, if I need to create a new table to hold other information, would this
be a reason to have a primary key - then create a relationship with my
existing table?

Yep. Your new (many side, I presume) table would need to have a "foreign key"
linkiing to the primary key of your main table.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top