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 |
|
mflammia
Starting Member
44 Posts |
Posted - 2008-08-06 : 05:14:46
|
| Trying to write a query to compare a linked DB and a local DB.This query returns the column ListingTitle form my linked serverselect * from openquery (TTDNY1,'Select listingTitle from listings')This query returns everything from my local databaseSelect * from realessex.dbo._DATAThe idea is to return everything from the local database that match’s its _name column to the ListingTitle column in the linked server.Being a pure newbie writing simple queries is about my limit, so would really appreciate the help.Many thanks. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-06 : 05:23:32
|
| Select t1.* from realessex.dbo._DATA as t1 inner join ( select * from openquery (TTDNY1,'Select listingTitle from listings')) as t2 on t1.name=t2.listingTitleMadhivananFailing to plan is Planning to fail |
 |
|
|
mflammia
Starting Member
44 Posts |
Posted - 2008-08-06 : 05:32:36
|
| Wonderful! Thank you. |
 |
|
|
mflammia
Starting Member
44 Posts |
Posted - 2008-10-07 : 10:46:16
|
| Am trying to display everything from the realessex.dbo_DATA that has not been matched against TTDNY1 listingtitles, my first thoughts are to change the equal = to a not equal <>, but that does not give the desired results.That makes sense to me to do that, any ideas why that is not working?Thanks. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-07 : 10:49:23
|
| Select t1.* from realessex.dbo._DATA as t1 left join (select * from openquery (TTDNY1,'Select listingTitle from listings')) as t2 on t2.listingTitle is nullMadhivananFailing to plan is Planning to fail |
 |
|
|
mflammia
Starting Member
44 Posts |
Posted - 2008-10-07 : 10:53:16
|
| Great! Thanks. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-10-07 : 10:55:36
|
quote: Originally posted by mflammia Great! Thanks.
You are welcome MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|