A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Why can't a primary key be duplicated?



 
 
Thread Tools Display Modes
  #1  
Old March 26th, 2010, 03:05 AM posted to microsoft.public.access
torijoshmom
external usenet poster
 
Posts: 1
Default Why can't a primary key be duplicated?

Why can't a primary key be duplicated in Access?
  #2  
Old March 26th, 2010, 03:16 AM posted to microsoft.public.access
Ken Snell
external usenet poster
 
Posts: 177
Default Why can't a primary key be duplicated?

Because a primary key, by definition, identifies a unique record within a
table. If it can be duplicated, then you don't have uniquely identifiable
records in your table.
--

Ken Snell
http://www.accessmvp.com/KDSnell/


"torijoshmom" wrote in message
...
Why can't a primary key be duplicated in Access?



  #3  
Old March 26th, 2010, 03:18 AM posted to microsoft.public.access
Tony Toews [MVP]
external usenet poster
 
Posts: 3,776
Default Why can't a primary key be duplicated?

torijoshmom wrote:

Why can't a primary key be duplicated in Access?


For the same reason you can't have the same address referring to two
different buildings.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
  #4  
Old March 26th, 2010, 02:55 PM posted to microsoft.public.access
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Why can't a primary key be duplicated?

It's not just Access. No relational database will allow duplicate data in the
primary key field of a table.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"torijoshmom" wrote:

Why can't a primary key be duplicated in Access?

  #5  
Old March 26th, 2010, 04:41 PM posted to microsoft.public.access
Paul Shapiro
external usenet poster
 
Posts: 635
Default Why can't a primary key be duplicated?

Maybe if you describe the table, its definition, and the columns in the
table someone might be able to suggest a better data structure and/or a
better primary key. As others said, a unique primary key is a requirement in
a properly designed data structure.

"Jerry Whittle" wrote in message
...
It's not just Access. No relational database will allow duplicate data in
the
primary key field of a table.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"torijoshmom" wrote:

Why can't a primary key be duplicated in Access?


  #6  
Old March 28th, 2010, 01:56 PM posted to microsoft.public.access
David Portas
external usenet poster
 
Posts: 22
Default Why can't a primary key be duplicated?

"torijoshmom" wrote in message
...
Why can't a primary key be duplicated in Access?


The reason for creating key constraints in a database is to help ensure the
integrity of the data. When you create any candidate key constraint you are
explicitly specifying a rule that says the DBMS must not allow data for the
key attributes to be duplicated. Any update that would cause duplication is
therefore rejected as an error.

If requirements change and you decide it's no longer appropriate to enforce
that rule then you should drop the candidate key constraint and define some
other key instead.

I recommend you study a book on database basics or take a good introductory
course because this is pretty fundamental stuff.

--
David Portas


  #7  
Old March 29th, 2010, 06:14 PM posted to microsoft.public.access
torijoshmom[_2_]
external usenet poster
 
Posts: 1
Default Why can't a primary key be duplicated?

thank you for shedding some light on the question. your input is greatly appreciated


---
frmsrcurl: http://msgroups.net/microsoft.public...-be-duplicated
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.