Solved

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

Posted on 2014-12-01
4
181 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 32

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now