dbTalk Databases Forums  

SSIS: join tables in different datasources (connection managers)

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS: join tables in different datasources (connection managers) in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cgian31
 
Posts: n/a

Default SSIS: join tables in different datasources (connection managers) - 06-07-2006 , 07:54 AM






I need to periodically import a (HUGE) table of data from an external
data source into SQL Server, with the following scenarios:

1- Some of the records in the external data source may not exist in
SQL.
2- Some of the records in the external data source may have a different
value at different imports, but this records are identified univocally
by the same primary key in the external datasource and in SQL Server.
3- Some of the records in the external data source may be the same in
SQL.

Due to the massive volume of the import, I would like to import only
the records which are different from what I have in SQL Server (cases 1
and 2 above)

I thought of making a query with a left outer join between the data in
the external data source table (SOURCE) and the data in the SQL Server
table (DESTIN). The join is done on the primary keys. One of the WHERE
conditions will be that the value in SOURCE is different from the value
in DESTIN.

The result of this query would be exactly what I need to import.

How to do this in SSIS???
I couldn't figure out how to join tables in different data sources yet.


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS: join tables in different datasources (connection managers) - 06-07-2006 , 08:03 AM






Hello cgian31,


Have you had a look at the Merge Join?


This component should do exactly what you want.

That said it will require that you bring in ALL rows from both sides of the
join before doing the joining.


Have you looked at linked severs?


Allan



Quote:
I need to periodically import a (HUGE) table of data from an external
data source into SQL Server, with the following scenarios:

1- Some of the records in the external data source may not exist in
SQL.
2- Some of the records in the external data source may have a
different
value at different imports, but this records are identified univocally
by the same primary key in the external datasource and in SQL Server.
3- Some of the records in the external data source may be the same in
SQL.
Due to the massive volume of the import, I would like to import only
the records which are different from what I have in SQL Server (cases
1 and 2 above)

I thought of making a query with a left outer join between the data in
the external data source table (SOURCE) and the data in the SQL Server
table (DESTIN). The join is done on the primary keys. One of the WHERE
conditions will be that the value in SOURCE is different from the
value in DESTIN.

The result of this query would be exactly what I need to import.

How to do this in SSIS???
I couldn't figure out how to join tables in different data sources
yet.



Reply With Quote
  #3  
Old   
cgian31
 
Posts: n/a

Default Re: SSIS: join tables in different datasources (connection managers) - 06-07-2006 , 09:55 AM



I think linked servers is not a possibility since the source is a MS
Access file.

The Merge Join needs the data to be sorted, which is really
discouraging in terms of performances...

But thanks anyway!

Allan Mitchell ha scritto:

Quote:
Hello cgian31,


Have you had a look at the Merge Join?


This component should do exactly what you want.

That said it will require that you bring in ALL rows from both sides of the
join before doing the joining.


Have you looked at linked severs?


Allan


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS: join tables in different datasources (connection managers) - 06-07-2006 , 10:00 AM



Hello cgian31,

Access can be a linked server. have you looked at OPENDATASOURCE()?

Yes Merge Join requires a sorted input but you can do that on the source
and flag the Source Adapter as the data is already sorted.

Allan

Quote:
I think linked servers is not a possibility since the source is a MS
Access file.

The Merge Join needs the data to be sorted, which is really
discouraging in terms of performances...

But thanks anyway!

Allan Mitchell ha scritto:

Hello cgian31,

Have you had a look at the Merge Join?

This component should do exactly what you want.

That said it will require that you bring in ALL rows from both sides
of the join before doing the joining.

Have you looked at linked severs?

Allan




Reply With Quote
  #5  
Old   
cgian31
 
Posts: n/a

Default Re: SSIS: join tables in different datasources (connection managers) - 06-08-2006 , 02:04 AM



It sounds great, thank you.


Reply With Quote
  #6  
Old   
cgian31
 
Posts: n/a

Default Re: SSIS: join tables in different datasources (connection managers) - 06-08-2006 , 05:27 PM



the database is running on a win 2003 64 bit machine, when I try to use
opendatasource it mentions that oledb.jet.4.0 is not registered on this
pc.
Therefore it seems i cannot use it.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.