Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Help: creating relationship between two tables

Author  Topic 

Brittney10
Posting Yak Master

154 Posts

Posted - 2010-08-08 : 20:09:04
I have two tables. TableA and TableB. TableA contains two columns ID and NAME, while TableB contains NAME. I need to be able to look up NAME in TableA and return the ID that matches the NAME to TableB. So both TableA and TableB will have NAME and ID columns that relate to one another. Here's an example:

What I have.....

TableA

ID NAME
1 Smith
2 Jane
3 Doe

TableB

NAME
Smith
Jane
Doe

What i need....

TableA

ID NAME
1 Smith
2 Jane
3 Doe

TableB

ID NAME
1 Smith
2 Jane
3 Doe

Thanks in advance!
   

- Advertisement -