473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Separate PK in Jxn Tbl?

Whenever I've created junction tables in the past, I always made the PK of
the junction table the combined pks from the two other tables. Ex: Table1
PK=A; Table2 PK=B; Junction table consists of two fields, A and B, which
together comprise the PK for the junction table.

However, I just came across some code in which the person created a junction
table with a separate PK consisting of an autonumber field, and then the two
fields.

So I was wondering how others did junction tables -- with a standalone
autonumber PK, or with a PK consisting of the PKs of the tables being
joined? And, if a standalone PK, then why?

Thanks!

Neil
Jan 22 '08
116 5054
I was making a direct reference to the following quote:
In a recent thread on this subject, Tony Toews Access MVP qualified
that he liked using incremental autonumbers (rather than random)
because they where easier to type (WHERE ID = -2001736589 may
encourage typos) and easier to drop into conversation ("Hello Tony?
I'm seeing a problem with the record where the ID is -2001736589...").
Of course, theoritically and in a world with unlimited budget, you're right
in the sense that a surrogate key should never cross the boundaries of a
database (the interface beeing located inside in these boundaries) but my
clients don't have infinite budget and my brain isn't infinite either.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)
"Jamie Collins" <ja**********@xsmail.comwrote in message
news:a3**********************************@q77g2000 hsh.googlegroups.com...
On Jan 28, 5:30 pm, "Sylvain Lafontaine" <sylvain aei ca (fill the
blanks, no >
>if you live in a perfect world, one with infinite budget and infinite
time to do any project, then I understand your concerns.

if I
were to live in a perfect world, I wouldn't have to work to earn a living
in
the first place.

Are you really aiming your comments at me? I've already said in this
thread that I frequently encounter 'autonumber' problems so how could
that be a "perfect world" for me?
>I understand your concerns.

Oh yeah? Do you understand that my concern is not that Access MVPs in
typically use autonumbers on most, if not all, their tables? I'm sure
they know enough to make their own decisions. Rather, my concern is
that Tony Toews Access MVPs would promote such practise without giving
good reasons or presenting a balanced view, and that readers will he
says because of the letters M, V and P and in lieu of understanding
the issues themselves. Once again, I should say I have no problem with
Tony Toews Access MVP generally, I think he was just having an off day
or perhaps wanted to provoke a response by being flippant. And I've no
problem with anyone being provocative round here (I'd be a hypocrite
if I said I did <g>).
>you cannot codifying everything for a variety of
reasons: budget, system already in place and working well, impossibility
to
anticipate everything, more art than a science, etc., etc.

Hm, "codifying" is not a word I'm overly familiar with, I had to look
it up: "the process of collecting and restating the law of a
jurisdiction in certain areas, usually by subject... To arrange or
systematize". If that's an accusation then Tony is just as guilty as I
with his, "It's one of my rules" comment.
>Why would they pay to
change something that had worked well for them for many years and at the
risk of finding themselves at the front of something new that might not
work
as well as the one system?

Did I suggest they should? Re-engineering code for the sake of it is
not my philosophy and I offer the following recent thread in evidence:

http://groups.google.com/group/micro...635944f8042608

Pete says my real question/agenda is: Should I go through my app
and change everything that's Double to Decimal?
Jamie saysI don't think you should reengineer your code in the way
you suggest.
>That would be committing the same mistake as those who add an
autonumber primary key to every table i.e. done out of habit, knee
jerk reaction rather than engaging the brain. Fix bugs instead ;-)

Back to the current thread:
>this system is working well at the moment and has
done so for many years; it would probably make your teeth gnashing but
it's
not on their radar at this moment to change it.

I'm sure that if I looked at code I wrote last year that is working
well at the moment I'd want to do it differently given the opportunity
but I wouldn't seek to create such an opportunity; I'd rather put it
down to experience and tackle something new.
>In this message, you can replace the name of Celko with the name of a lot
of
persons around here but not with mine.

So are you aiming you comments at me directly, merely implicating me
or have you just chosen to attach your 'rant' to my post at random?

Jamie.

--

Jan 29 '08 #101
Keith Wilby wrote:
"Frank Hamersley" <te*************@bigpond.comwrote in message
news:91*****************@news-server.bigpond.net.au...
>>
provision of a menu option to reattach a data .mdb!

Is it just me or is that complete gibberish? Reattach?
Just you mate (at least I hope so or we are doomed).

Pray tell how do you distribute new versions of "code"?

Never had that concern? - always just hacked the live .mdb?

Gawd.
Jan 29 '08 #102
JOG
On Jan 29, 8:37 pm, Marshall <marshall.spi...@gmail.comwrote:
On Jan 29, 7:56 am, "Neil" <nos...@nospam.netwrote:
"Jamie Collins" <jamiecoll...@xsmail.comwrote in message
Here in the UK I avoid using the word 'moot' when trying to write
'plain English' simply because the US usage has obscured the UK usage
i.e. it can cause confusion.
You could use the alternate "moo" point, meaning that the point is full of
methane gas. At least it would be clear what you mean.... ;-)

Amusingly, a lot of people misperceive the word as "mute."
This probably comes from you fellas over the pond not pronouncing
words (*cough*) correctly. Mute should of course be pronounced at
though there was a y between the m and the u!

In fact, I challenge you to a dool next Toosday morning to settle the
matter, right after I've eaten my moosli ;P

>
It's a mute point, meaning it can't say anything any longer.
It sorta vaguely works in a metaphoric way.

Of course, on the internet, you can find many examples of
fractured usage. Ultimately it's just a waist of time.<snicker>

Marshall
Jan 29 '08 #103
"Keith Wilby" <he**@there.comwrote:
>But then again the US don't have colour television programmes either do
they? Or aluminium ;-)
We in Canada do have colour TVs, although I don't actually own one. But we don't
have aluminium. So where does that put us?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Jan 30 '08 #104

"Marshall" <ma*************@gmail.comwrote in message
news:36**********************************@y5g2000h sf.googlegroups.com...
On Jan 29, 7:56 am, "Neil" <nos...@nospam.netwrote:
>"Jamie Collins" <jamiecoll...@xsmail.comwrote in message
Here in the UK I avoid using the word 'moot' when trying to write
'plain English' simply because the US usage has obscured the UK usage
i.e. it can cause confusion.

You could use the alternate "moo" point, meaning that the point is full
of
methane gas. At least it would be clear what you mean.... ;-)

Amusingly, a lot of people misperceive the word as "mute."

It's a mute point, meaning it can't say anything any longer.
It sorta vaguely works in a metaphoric way.

Of course, on the internet, you can find many examples of
fractured usage. Ultimately it's just a waist of time.<snicker>
Reminds me of a time that I was laughed at by a group of coworkers for
insisting that the phrase "that doesn't jibe" is correct, and "that doesn't
jive" (as they insisted) was incorrect. J-j-j-jive talking....

I also love the usage of "nip it in the butt" instead of "nip it in the
bud." One time I corrected someone for using "butt," and she apologized,
thinking I was offended by her use of the word "butt," and was creating my
own "softer" version with "bud" instead. Hahahaha!
Jan 30 '08 #105
>I have yet to have any of them rise to the challenge of siting a single example of a correctly set up, split application in Access that isn't stable under load. <<

Home Depot's contractor tracking system on ACCESS? It's failures are
famous in Atlanta.

Jan 31 '08 #106
Quoth Roy Hann:
What would be very nice is if one day it were possible for applications to
download the relevant constraints at run-time, the way they presently
download other metda-data.
Dataphor does this.
--
Jon
Feb 1 '08 #107
"Jon Heggland" <jo**********@ntnu.nowrote in message
news:fn**********@kuling.itea.ntnu.no...
Quoth Roy Hann:
>What would be very nice is if one day it were possible for applications
to download the relevant constraints at run-time, the way they presently
download other metda-data.

Dataphor does this.
You don't think I was clever enough to come up with the idea all by myself
do you? :-)

I admire what Dataphor set out to do. But having been forced to adopt SQL
against my will a long time ago, I am under no illusion that anything better
than SQL will ever catch on. The best hope is that embedded SQL might be
less stupid in future.

Roy
Feb 1 '08 #108
Quoth Roy Hann:
"Jon Heggland" <jo**********@ntnu.nowrote in message
news:fn**********@kuling.itea.ntnu.no...
>Quoth Roy Hann:
>>What would be very nice is if one day it were possible for applications
to download the relevant constraints at run-time, the way they presently
download other metda-data.
Dataphor does this.

You don't think I was clever enough to come up with the idea all by myself
do you? :-)
Why not? It's a pretty simple idea, really.
I admire what Dataphor set out to do. But having been forced to adopt SQL
against my will a long time ago, I am under no illusion that anything better
than SQL will ever catch on.
Well, Dataphor databases are typically built on top of SQL databases.
Just tell management that Dataphor is really just a presentation layer
on top of SQL. :)
The best hope is that embedded SQL might be less stupid in future.
If that was my best hope, i think I would quit being a database engineer.
--
Jon
Feb 1 '08 #109
"Jon Heggland" <jo**********@ntnu.nowrote in message
news:fn**********@kuling.itea.ntnu.no...
Quoth Roy Hann:
>The best hope is that embedded SQL might be less stupid in future.

If that was my best hope, i think I would quit being a database engineer.
I admire your optimism. Can we agree to meet again in this very place 20
years from now to discuss how it went? :-)

Roy
Feb 1 '08 #110

"Brian Selzer" <br***@selzer-software.comwrote in message
news:oM****************@newssvr12.news.prodigy.net ...
>
"Roy Hann" <sp*******@processed.almost.meatwrote in message
news:1I******************************@pipex.net...
"Brian Selzer" <br***@selzer-software.comwrote in message
news:p9****************@newssvr13.news.prodigy.net ...
>
Constraints should always be checked by the DBMS, not by applications.
I agree very heartily with the first part of this statement, for the
reasons you give below. I disagree with the second part (as stated).
There is no reason why applications shouldn't also test what constraints
they can. The problem is that they should not have hand-coded
re-implementations of the constraints because those will get out of sync
with the database over time. What would be very nice is if one day it
were
possible for applications to download the relevant constraints at
run-time, the way they presently download other metda-data.

That's a good point. I should have said instead, "Constraints should
always
be /enforced/ by the DBMS, not by applications." It is often a good thing
for an application to do some checking because it can reduce the number of
round-trips, and maybe even some transaction rollbacks.
I think that if an application does some checking, it will also do some
enforcing.

I think you might have been aiming at something like the following:

The DBMS should always enforce the constraints that it can enforce, rather
than relying on applications to refrain from writing data that violates the
constraints.

Note that the above is silent on what applications should or should not do
regarding constraints.
Feb 1 '08 #111

"David Cressey" <cr*******@verizon.netwrote in message
news:wOFoj.5442$4f.4907@trndny06...
>
"Brian Selzer" <br***@selzer-software.comwrote in message
news:oM****************@newssvr12.news.prodigy.net ...
>>
"Roy Hann" <sp*******@processed.almost.meatwrote in message
news:1I******************************@pipex.net.. .
"Brian Selzer" <br***@selzer-software.comwrote in message
news:p9****************@newssvr13.news.prodigy.net ...

Constraints should always be checked by the DBMS, not by applications.

I agree very heartily with the first part of this statement, for the
reasons you give below. I disagree with the second part (as stated).
There is no reason why applications shouldn't also test what
constraints
they can. The problem is that they should not have hand-coded
re-implementations of the constraints because those will get out of
sync
with the database over time. What would be very nice is if one day it
were
possible for applications to download the relevant constraints at
run-time, the way they presently download other metda-data.

That's a good point. I should have said instead, "Constraints should
always
>be /enforced/ by the DBMS, not by applications." It is often a good
thing
for an application to do some checking because it can reduce the number
of
round-trips, and maybe even some transaction rollbacks.

I think that if an application does some checking, it will also do some
enforcing.

I think you might have been aiming at something like the following:

The DBMS should always enforce the constraints that it can enforce, rather
than relying on applications to refrain from writing data that violates
the
constraints.

Note that the above is silent on what applications should or should not do
regarding constraints.
Yes.
>

Feb 1 '08 #112
David Cressey wrote:
>
>>Maybe many Access programmers prefer a single key to limit the number of
fields that get corrupted :-).


In that case, I believe they are wrong.
Access is way more likely than SQL Server to corrupt a primary key
field(s), especially when a large number of concurrent users are editing
under the same index value, perhaps while someone is also turning off
their computer without shutting down on a form bound to the same data.
It was a facetious consideration because that kind of corruption occurs
rarely in Access.

James A. Fortune
MP*******@FortuneJames.com
Feb 1 '08 #113
On Jan 31, 11:33 pm, "Roy Hann" <specia...@processed.almost.meat>
wrote:
The
problem is that they should not have hand-coded re-implementations of the
constraints because those will get out of sync with the database over time.
What would be very nice is if one day it were possible for applications to
download the relevant constraints at run-time, the way they presently
download other metda-data.
Ding ding ding ding ding ding! We have a winner!
Marshall
Feb 1 '08 #114
On Feb 1, 12:30 am, "Brian Selzer" <br...@selzer-software.comwrote:
"Roy Hann" <specia...@processed.almost.meatwrote in message
Constraints should always be checked by the DBMS, not by applications.
I agree very heartily with the first part of this statement, for the
reasons you give below. I disagree with the second part (as stated).
There is no reason why applications shouldn't also test what constraints
they can. The problem is that they should not have hand-coded
re-implementations of the constraints because those will get out of sync
with the database over time. What would be very nice is if one day it were
possible for applications to download the relevant constraints at
run-time, the way they presently download other metda-data.

That's a good point. I should have said instead, "Constraints should always
be /enforced/ by the DBMS, not by applications." It is often a good thing
for an application to do some checking because it can reduce the number of
round-trips, and maybe even some transaction rollbacks.
Yes. In addition, if the client code knows what the database's
constraints
are, it can provide better user experience, better error messages,
etc.
Marshall
Feb 1 '08 #115
Neil wrote:
mAsterdam wrote:
>Neil wrote:
>>mAsterdam wrote:
Neil wrote:
Larry Daugherty wrote:
>In the meantime OP is probably trying to hide the
>matches with which he started the fires....
Indeed. :-|
Why? This fire does shed light. Nice crosspost :-)
Yeah, there seems to be a terroritorial divide
between CDMA and CDT.
Weird.
Keep 'm dry. You may need them to burn down other fences.
Are you hailing me as a peacemaker?
No, as an enabler of memetic migration.
This can be quite violent.
I swear all I did was post a question.
I believe you.
But if it brings peace and unity to my brethren, then I will gladly accept
the prize at Stockholm next year. It would be my humble honor.
From the above it will be clear that
I would not consider nominating you.
Feb 2 '08 #116
"Frank Hamersley" <te*************@bigpond.comwrote in message
news:Bd*****************@news-server.bigpond.net.au...
Keith Wilby wrote:
>"Frank Hamersley" <te*************@bigpond.comwrote in message
news:91*****************@news-server.bigpond.net.au...
>>>
provision of a menu option to reattach a data .mdb!

Is it just me or is that complete gibberish? Reattach?

Just you mate (at least I hope so or we are doomed).

Pray tell how do you distribute new versions of "code"?

Never had that concern? - always just hacked the live .mdb?

Gawd.
No, you have a development copy of the front end, there's no "reattaching"
of code, you just make a new version of the front end available - front end:
code and all other objects except the tables. Gawd, gibberish indeed.
Feb 8 '08 #117

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Roberto Becerril | last post by:
Hi forum, i'm a little new in javascript and maybe you can help me. I have an html form and an icon, if i click on the icon, a new pop-up window is open and shows a list of numbers with a...
2
by: Mike Hennessy | last post by:
I'm looking for people's opinions and feedback regarding the design of the application tier, and how to best logically separate out the Data Access from the Business Object's. Per the Microsoft...
0
by: krzychu | last post by:
Hallo, I have an existing plone site called "info", I've added some scripts to it. I would like to have that plone site into a separate ZODB database(separate ..fs file). There is a MountFolder...
4
by: Scott Kinney | last post by:
I have an inventory database. I want to delete out-of-stock items from the main database, but keep them in a separate table so that I can reference data about them. I created a copy of the item...
6
by: Yanhao Zhu | last post by:
Hi, all, If I have an array like int m = new int { 0, 1, 2, 3 }, is there a way I can separate the array into two, like int m01 = somefunction?(m,0,2) // m01 will hold 1st and 2nd items in...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
2
by: Shahid Siddiqui | last post by:
I want to know that whether the asp.net pages are served through separate threads or separate processes?
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
3
by: LurfysMa | last post by:
I would like to hear opinions on the tradeoffs of putting the tables, forms, and queries for several related datasets in separate databases vs one combined database. I am working on an...
1
by: Silgd1 | last post by:
Hi All..... I am using netbeans 6.1 to create a web application(visual web jsf pages). I have a heavy task I need to run, so I run the task in a separate thread which is started from a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.