There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox firewall freezes freezing hard drive hardware hijackthis internet internet explorer itunes keyboard laptop malware motherboard mouse msn network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows xp winxp wireless
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Many to Many Crosss Reference


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
NewToPCGuy's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2002
22-Oct-2004, 11:02 PM #1
Many to Many Crosss Reference
I have two customer tables from two different sources. Both tables contain the same customers but both have there own unique Id's for these customers. Being that these tables are managed by two separate companies, I cannot alter these tables in any way.

I want to build a cross reference table to link these customers together. The problem is that both tables often list the same customer several times. Example:

Customer_Table_1
Cust_ID Cust_Name
123567 St. Johns
23456 Saint Johns


Customer_Table_2
Cust_ID Cust_Name
98765 St. Johns
45678 St John


The only way I can think to link these two tables would be as follows:

Cust_Id_Xref_Table
Cust_ID_1 Table_ID New_Cust_Id
123567 1 1000
23456 1 1000
98765 2 1000
45678 2 1000


These three columns would make the new PK of the new table.

Considering that i cannot clean the original tables, this is the only solution that I can come up with.

Does anyone know of a better way to handle this situation?

Thanks in advance
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
23-Oct-2004, 01:08 AM #2
Welcome to TSG.

What you've come up with is, IMO the best way to handle this.
ddockstader's Avatar
Senior Member with 130 posts.
 
Join Date: Oct 2004
Experience: Advanced
23-Oct-2004, 11:18 AM #3
Thumbs up That's It
Welcome to Relational Databases and the world according to C. J. Date. What you describe is the way to handle many-to-many relationships. Now, you can speed up any queries by indexing that resulting table, but that's the textbook answer.
NewToPCGuy's Avatar
Junior Member with 9 posts.
 
Join Date: Oct 2002
23-Oct-2004, 02:37 PM #4
Thanks
Many thanks for the confirmation!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:24 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.