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 |
ericwebb
Starting Member
1 Post |
Posted - 2014-02-04 : 19:37:15
|
Hi Everyone,Need help on using sub queries with linked openqueryTrying to query two different servers such asselect *from linked1.test..nameswhere fname in (select fname from employees where active = 1)The above will get results but will download the thousands of records and waste resources. I am trying below with openquery but cannot get it to work. Can someone assist?Select * from OpenQuery (linked1, 'Select * from test..names where in ' (select fname from employees where active = 1) ')What is the best way to accomplish the above? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-02-11 : 01:35:36
|
[code]select *from linked1.test..names linner join employees eon e.fname = l.fname and e.active = 1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|