Passthrough Question

  • Thread starter Thread starter TJ
  • Start date Start date
T

TJ

In my DB I have ODBC connections that link up to different data sources. The
tables in each of these databases are enormous and I would like to cut down
query time by building some passthroughs. I know how to build passthroughs
that link to a single datasource but is it possible to link to two seperate
datasources within a single query? If so then what do you put in the
connection string?

-TJ
 
If your p-t is connected to SQL Server, you can run a select from a different
server with either a linked server or syntax like:

SELECT choChoID, choFacID, choLINNUM, choLINNAM, choARTNUMFrom,
choARTNAMFrom, choARTNUMTo, choARTNAMTo
,choPEHDAT, choPEHSTT, choGPH, choQty, choStopDuration, choLaborHrs,
choSTGNUM, choSTGNAM
,choComments, choLastUpdater, choLastUpdate, choCoSID
FROM OPENDATASOURCE('SQLOLEDB',
'Server=SERVERNAME;User ID=XXXX;Password=xxxx'
).SAMCorp.dbo.tblChangeovers
 
So If I wanted to join table A from server A to table B from server B then
would I use the same type of syntax as you listed below seperating the
OPENDATASOURCE command with inner join?
 
I believe this would work with a JOIN to a table from the current database
server.
You could create a view using the syntax I provided and then do a simple join.

I haven't tried this so let us know how it works out. I don't know how
efficient this is.
 
Back
Top