[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

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

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
Jim Horn
Asked:
Jim Horn
  • 2
1 Solution
 
ste5anSenior DeveloperCommented:
Does a simple 1= <@BIT::import> not work?
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
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
 
JimFiveCommented:
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
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
That's a good workaround that doesn't alter any of my data flow tasks.  Thanks.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now