dbTalk Databases Forums  

Sequence of nearly identical tasks for different tables

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


Discuss Sequence of nearly identical tasks for different tables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nils Magnus Englund
 
Posts: n/a

Default Sequence of nearly identical tasks for different tables - 08-12-2006 , 05:50 AM






Hello,

I'm just starting to use SSIS, and I would appreciate some help on my
current challenge...

I have 20 source views I want to fetch data from, and insert them into 20
nearly identical destination tables in another database. The destination
tables have the same columns as the source views, in addition to a
"TransferId" column (to uniquely identify that specific data transfer).

I use a "Conditional Split" data flow task after the source to filter out
specific rows from the views (I only use a single output from the
Conditional Split).

Between the "Conditional Split" and the destination, I use a "Derived
Column" to fetch the value for the "TransferId" column from the variable
@TransferId.

I was starting to make nearly identical data flow tasks for each of the
view/table pairs when I thought that there must be a better way... Is it
possible to use a loop to perform the same task for all 20 views and tables?
The field names are identical in all the view/table pairs (except for the
"TransferId" column as specified above), so I'm hoping there's some sort of
auto-mapping I could use...

Thanks for any help and suggestions, all are welcome!


Regards,
Nils Magnus Englund



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

Default Re: Sequence of nearly identical tasks for different tables - 08-13-2006 , 06:27 AM






Hello Nils,

If everything is the exact same as it sounds then it should be a case of
simply calling the right view in the source adapter and the right destination
in the destination adpater. The fact that the @TransferID variable value
changes makes no difference because it is a data value and will not change
the fabric of the package/data flow.

You could grab the name of the views you want to use as the source and destinations
through a query and then use a variable as the source and destination object
names. You could then loop over this collection using a ForEach loop.

Allan


Quote:
Hello,

I'm just starting to use SSIS, and I would appreciate some help on my
current challenge...

I have 20 source views I want to fetch data from, and insert them into
20 nearly identical destination tables in another database. The
destination tables have the same columns as the source views, in
addition to a "TransferId" column (to uniquely identify that specific
data transfer).

I use a "Conditional Split" data flow task after the source to filter
out specific rows from the views (I only use a single output from the
Conditional Split).

Between the "Conditional Split" and the destination, I use a "Derived
Column" to fetch the value for the "TransferId" column from the
variable @TransferId.

I was starting to make nearly identical data flow tasks for each of
the view/table pairs when I thought that there must be a better way...
Is it possible to use a loop to perform the same task for all 20 views
and tables? The field names are identical in all the view/table pairs
(except for the "TransferId" column as specified above), so I'm hoping
there's some sort of auto-mapping I could use...

Thanks for any help and suggestions, all are welcome!

Regards,
Nils Magnus Englund



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.