dbTalk Databases Forums  

Transfer related tables in one Dataflow

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


Discuss Transfer related tables in one Dataflow in the microsoft.public.sqlserver.dts forum.



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

Default Transfer related tables in one Dataflow - 06-23-2008 , 04:57 PM






Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?

Reply With Quote
  #2  
Old   
matteus
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM






On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


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

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


Reply With Quote
  #4  
Old   
matteus
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


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

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


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

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


Reply With Quote
  #7  
Old   
matteus
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


Reply With Quote
  #8  
Old   
matteus
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


Reply With Quote
  #9  
Old   
matteus
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 10:38 AM



On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com>
wrote:
Quote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?
Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


Reply With Quote
  #10  
Old   
Yuriy Al
 
Posts: n/a

Default Re: Transfer related tables in one Dataflow - 06-24-2008 , 11:14 AM



Hi Matteus,

Thank you for your response.
From what I understand that you within the same dataflow insert ONE ROW for
parent and appropriate ROWS for child. How do you ensure that parent row is
always inserted/written to the destination prior to the child rows?

Thanks,
Yuriy

"matteus" wrote:

Quote:
On Jun 23, 11:57 pm, Yuriy Al <Yuri... (AT) discussions (DOT) microsoft.com
wrote:
Hello All,

Is there any way to transfer related tables in one Dataflow? I found a
couple of articles in Internet, but they recommend using 2 dataflows or raw
files. My dataload is within distributed transaction, so it can not be raw
files.

I have following requirement. There are 2 tables related in one-to-many
relationship with FK constraint. I need to transfer data from them from one
DB server to another as is without any transformations. Records to be
transferred should be selected using SQL Command as the requirement is to
manages bulks and ID from which to start transferring.

In test environment I was able to create dataflow were 2 data sources - one
for parent table and one for child. Data from parent flows to "multicast"
transformation, and from there one flow goes to parent destination and second
is joined (inner join) with data from child source and goes to child
destination. It works perfect in test, but I am not sure that insert into
parent will be always done prior to insert into child. Is there any way to
explicitly configure the sequence?

Hi Yuriy,
don't exaclty know if this can work in a distributed transaction...
but for a similar problem (two tables related with a fk constraints)
- I created an execute sql task, in which i select all and only the PK
column of the parent table and put the result set in an object
variable
- loop through each item of that variable with a for each loop
container (i built another variable containing the "current" value ok
the PK)
- create a data flow inside that each loop container
- select and insert the ROW corresponding to the current value (second
var) on the destination parent table
- select and insert the ROWS corresponding to the current value
(second var) on the destination child table

Let me know if this could help you
M.


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.