>That what openquery is for. You can send pass-through query to the specified linked server. Fox is in my case.
>Problem is to build a complete string with parameters. Too many quotes.
If the linked server is Fox and you want to use strings do this:
select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt
from aritrs a
inner join arinvc b on a.cInvNo=b.cInvNo
where a.cCustno+a.cInvNo like "'+@StringPar+'%" and cType= ""')
this is not tested.
As you see you can use double quotes ub the query string if the linked server accepts them.
You even can use square brackets:
select * from openquery(VAMCPD,'select a.cItemno,a.nShipQty,a.nSalesAmt-a.nDiscAmt as Amt
from aritrs a
inner join arinvc b on a.cInvNo=b.cInvNo
where a.cCustno+a.cInvNo like ['+@StringPar+'%] and cType= []')
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.