user229564
user229564

Reputation:

Calling a Programatic Inner Join in VB ResultSets

We have an item cull that retrieves items and their appropriate data from one server. Their Primary Keys need to be INNER JOINed with another table. However, the second table is on another server. We can retrieve that data using a separate select statement and accompanying VB objects.

How would one go about this programmatically in VB? Is a loop the best practice available? Although we are in a Microsoft Ecosystem, Server Linking is not possible.

Upvotes: 1

Views: 156

Answers (1)

purplesoft
purplesoft

Reputation: 526

Use openrowset statement.

Syntax:

SELECT * 
FROM   OPENROWSET('SQLNCLI10', 
       'server=REMOTEDBSERVERNAME;database=DBNAME;uid=USERID;pwd=PASSWORD', 
       'SELECT * FROM   table') 

Try it.

Tiz

Upvotes: 1

Related Questions