Solved

Can I join these two tables?

Posted on 2013-05-15
3
303 Views
Last Modified: 2013-05-15
I want to join two tables. TableA to TableB.

TableA has a Primary Key but TableB has no foreign key.

They both have a column named Type1_ID.  And Type1_ID is not a primary or foreign key in either table.

Is there a best practice approach in this type of situation?
0
Comment
Question by:rhservan
3 Comments
 

Expert Comment

by:STHOMP02169
ID: 39168801
Joining on a primary or foreign key isn't required. You do want to make your join unique though. Can you provide a little more infromation on the nature of the two tables? Do both contain attributes of a specific fact? or does TableB define Type1_ID?
0
 

Author Comment

by:rhservan
ID: 39168830
Yes on the attributes.  

Type1_ID column in TableA & TableB are define the same.
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39168837
To join tables, you need some way of specifying the relationship between the two.  That is, you have to have some way of identifying which row(s) on TableB correspond to a given row on TableA, and vice versa.

So, if the relationship is based on having the same values in the Type1_ID columns, then yes, joining on that is perfectly fine.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now