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.
| Author |
Topic |
|
spowell
Starting Member
23 Posts |
Posted - 2008-09-28 : 16:49:41
|
| HiI am quite new to sql and really need some help with this. I am trying to create a report that shows the name, address, phone number & product sold to 16,000 customers. The problem I have is that this information is in 2 seperate databases. The first database is called dbo.maindata_withphone2709 and has all the contact information in (for 100,000 records) and the second database is called dbo.tblcompletion whihch has the product information in. The only link between the tables is a unique id number.The columns I need to display from each database aredbo.maindata_withphone2709 IDPrefixFirstnameSurnameAddress_1Address_2Address_3PostcodeTelephonedbo.tblcompletion IDAgreed_productCommissionAny help will be greatly appreciatedSteve |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-09-28 : 16:55:01
|
| Two different databases, or two different tables? From the names you gave, those are two separate tables and can be simply joined together with an INNER JOINSELECT <column list>FROM dbo.maindata_withphone2709 maindata INNER JOIN dbo.tblcompletion compl on maindata.id = compl.id--Gail ShawSQL Server MVP |
 |
|
|
spowell
Starting Member
23 Posts |
Posted - 2008-09-28 : 17:45:46
|
| Thanks a lot. That worked perfectly |
 |
|
|
|
|
|