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 |
|
gilgamesh
Starting Member
14 Posts |
Posted - 2002-05-15 : 06:04:27
|
| Please help. I need to produce an alphabetical listing of two tables in separate databases (on the same SQL Server) that meet a certain criteria.CUSTOMER TABLESelect CustCode where CustAccNo = XXXXXSelect firstName, lastName where Sponsor = CustCodeand alphabetically sort that withADDRESSBK TABLESelect firstName, lastName where Sponsor = XXXXXShould this be done with Stored Procedure - oh please help its driving me mad!Many thanks in advance! |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-05-15 : 06:24:18
|
| look at the UNION construct...and you will also have to specify both tables with their full qualification....select a,b from server1.database1.owner1.table1 where a = xxx'unionselect a,b from server2.database2.owner2.table2 where b = zorder by 1,2the databasex.ownerx part may need to be reversed ie....ownerx.databasexdo a FORUM SEARCH on tables + servers...should give some useful links to explain this. |
 |
|
|
gilgamesh
Starting Member
14 Posts |
Posted - 2002-05-15 : 06:40:50
|
Thanks a lot Andrew |
 |
|
|
|
|
|