SQL Server Integration Services

Cindy Vo-Lake 0 Reputation points
2023-11-01T13:13:33.1233333+00:00

How to link data from two databases on two different servers?

The goal is to get this query into a table on a third database using a join on a unique identifier and several filter criteria. One of the source databases has millions of records.

I have attempted to execute this by creating two OLE DB Sources feeding into a Merge Join with an OLE DB Destination. However, I get 0 records written in the OLE DB Destination. Please see Data Flow diagram below. DB 2 and DB 3 are on the same servers. DB 1 on Server 1 has millions of records. The Data access mode for DB 1 is using a SQL command text. I am to preview the SQL command successfully. The SQL command text is:

SELECT Column A, Column B, Column C, Column D, Column E, Column F

FROM DB 1

WHERE (COLUMN C > '1/1/2020') AND (COLUMN X > '10/01/2023') AND (COLUMN Y = 'USA')

User's image

The current Merge Join is using an inner join. I have also set the IsSorted property to True for the OLE DB Source Output and set the SortKeyPosition to 1 for one of the Output Columns.

User's image

User's image

Some of the results in the Output Debug are listed below:

Information: 0x4004800C at Data Flow Task, SSIS.Pipeline: The buffer manager detected that the system was low on virtual memory, but was unable to swap out any buffers. 4 buffers were considered and 2 were locked. Either not enough memory is available to the pipeline because not enough is installed, other processes are using it, or too many buffers are locked.

SSIS package "C:\Users....\Package.dtsx" finished: Success.

The program '[9752] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).

If there are more efficient work flows, please advise. Any guidance is much appreciated. Thank you for your time!

Very Best,
Cindy

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yitzhak Khabinsky 26,586 Reputation points
    2023-11-01T14:05:37.1066667+00:00

    Hi @Cindy Vo-Lake,

    DB 1 on Server 1 has millions of records.

    • Temporarily just for test, you can try to limit data volume from the DB1:
      SELECT TOP(10000) * FROM ...;
    • Because JOIN is done in SSIS Data Flow Task (DFT) that machine will need more available RAM memory. No question about it.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.