Is it possible to construct a dynamic query to for a linked server (and if so how)?
For example:
@linkedServer varchar(50)
@var1 varchar(10)
@var2 varchar(10)
select *
from openquery(@linkedServer,
'select c1,c2
from t1
where p1 = @var1
and p2= @var2')