?
Solved

What task or combo of tasks can I use in ssis 2015 to load different file names into different tables into sql server?

Posted on 2016-09-28
7
Medium Priority
?
85 Views
Last Modified: 2016-10-17
I have a for each look container using folder and filename variables.  The initial dataflow task in the for each loop container does a conditional split on the file name (2 different file names) and inserts into a seperate initial staging table for each file.  The inital data flow has 2 precedence constraints with expression and constraint for the filename and then processes to seperate subsequent dataflows for each file.   Dataflow for file1 is reprocessing 1 extra file.  screenprint attached.
packageflow.docx
0
Comment
Question by:conardb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 41820145
What exactly is your question here?
0
 

Author Comment

by:conardb
ID: 41820371
Is using a dataflow task with conditional split on filename(s) to process different files with different layouts a proper approach to use ssis tasks?    What is your expert opinion?
0
 
LVL 16

Expert Comment

by:Megan Brooks
ID: 41822454
If it works and is fast enough, use it. If you think you might need to support additional filenames in the future, you might want to consider what would facilitate doing that.

You mention both data flow tasks (shown in the attachment) and conditional splits, which are transformations within a data flow task. What is the purpose of testing the filename at both levels?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 66

Accepted Solution

by:
Jim Horn earned 1000 total points
ID: 41822459
Not exactly.  Data flows are meant for a single source definition and single destination definition, so if your 'different layouts' implies multiple definitions then this needs to be handled using conditional split logic and multiple data flow tasks (aka data pumps) for each unique source/destination definition.
0
 

Author Comment

by:conardb
ID: 41825372
ok, thanks... Presently, I have 1 dataflow that is using conditional split logic to select by file name from the same directory each of 2 different files / formats and write to a different staging table for each.  Then seperate dataflows for each of those types derive the fixed length non-delimted row into  seperate sql server tables.  It's working but I suspected not best practice as the filter by name is redundantly used in the initial dataflow then afterward as a precedence to direct processing to derive to seperate tables .  Jim, could you provide an example or link to an example of your approach?  Thanks again.
0
 
LVL 16

Assisted Solution

by:Megan Brooks
Megan Brooks earned 1000 total points
ID: 41825809
Looking back at your original attachment, it looks like you have a task flow that uses conditional constraints to select one set of sequential data flows or another (conditional split is a data transformation component, not something you would use in the task flow).

Now that I understand the terminology substitutions, the logic looks OK. I only see one set of conditional constraints in the diagram, and there shouldn't be any redundancy in that. Both expressions will be evaluated, but if they are complementary then only one path will continue on for each iteration. Because you are working with constraints, not branching logic, that's what you need to do to use this design.

It seems like it might be clearer if not easier to run two separate for-each loops, eliminating the conditional constraints, and adjusting the file patterns accordingly.

Is the reprocessing that you mentioned initially intended or unintended? Is there a bug to be addressed?
0
 

Author Closing Comment

by:conardb
ID: 41846805
sorry I took so long, thanks again
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question