Solved

SSIS 2008:  Conditional logic to use different sources in Data Flow Task

Posted on 2014-12-01
4
193 Views
Last Modified: 2016-02-17
Hi All

I have an SSIS 2008 package with data flow task using Task Factory Salesforce.com source, and in the WHERE clause is the below statement, which works fine. conditional-source-load-all.jpg
I'd like to pull off a conditional 'IF @load_all_data=True THEN do not include the above WHERE clause, and if False then include it.  I've been told that this is not possible in Salesforce Object Query Language (SOQL) to include that logic in the WHERE clause of the above query, which means that I'll need two separate data sources:  one with the current WHERE.., and one without.

I'd prefer not to copy-paste each data flow task, and the only different being the WHERE clause, to pull this off.

Question:  What's the easiest way to pull off two sources based on logic with a parameter in a data flow task, using the same destination?  Preferably without a JOIN that requires sorting.

Thanks in advance.
Jim
0
Comment
Question by:Jim Horn
  • 2
4 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 40475472
Does a simple 1= <@BIT::import> not work?
0
 
LVL 65

Author Comment

by:Jim Horn
ID: 40476264
Not in SalesForce SOQL, as WHERE criteria has to be column = variable, and can't be variable = value.
See the link below the image.
0
 
LVL 15

Accepted Solution

by:
JimFive earned 500 total points
ID: 40476356
I have two options:  Use a local Procedure variable and set it to 0 if @load_all_data = true, set it to @user::date_last_success if @load_all_data = false then use WHERE SystemModStamp = @localvar

Alternatively, set @user::date_last_success = 0 if @load_all_data = true before this step in the process.

Good Luck
0
 
LVL 65

Author Closing Comment

by:Jim Horn
ID: 40476406
That's a good workaround that doesn't alter any of my data flow tasks.  Thanks.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
View SQL 2005 Job package 16 41
Slow Connectivity over ODBC 8 32
T-SQL: Do I need CLUSTERED here? 13 41
T-SQL:  Collapsing 9 22
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

776 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