Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8570209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:30:24+00:00 2026-06-11T18:30:24+00:00

1.Script Task: set arrays of (A) inventory count and (B) StoreNr 2.Data flow task:

  • 0

1.Script Task: set arrays of (A) inventory count and (B) StoreNr
2.Data flow task: Use the list variables in where clauses (to filter and thereby speed up performance)

*Script task must read from server A and Data flow task from server B.
I dont want to use linked server and dont want to filter downstream the dataflow, but instead want to filter through the where clauses in the dataflow source (OLE DB).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:30:25+00:00Added an answer on June 11, 2026 at 6:30 pm

    You may do it in two Data Flows.

    In first:

    1. Select value to be used in where from source table
    2. Store this values in string variable ListToBeFetched as comma separated list using Srcipt Component as destination witch code similar to:
    
    using System.Text;
    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    {
        StringBuilder sb;
        public override void PreExecute()
        {
            base.PreExecute();
            sb = new StringBuilder();
        }
    
        public override void PostExecute()
        {
            base.PostExecute();
            Variables.IdListToBeFetched = sb.ToString().TrimEnd(',');
        }
    
        public override void Input0_ProcessInputRow(Input0Buffer Row)
        {
            if (!Row.Value_IsNull)
            {
                sb.AppendFormat("{0},", Row.Value);
            }
        }
    }
    

    Do the same with second list.

    In second Data Flow set dynamic generated query as sql command in OLE DB Source (taken from Jamie Thomson blog):

    1. Create a new variable called SourceSQL
    2. Open up the properties pane for SourceSQL variable (by pressing F4)
    3. Set EvaluateAsExpression=TRUE
    4. Set Expression to "select * from table where columnToBeSearched in (" + @[User::ListToBeFetched] + ")"
    5. For your OLE DB Source component, open up the editor
    6. Set Data Access Mode=”SQL Command from variable”
    7. Set VariableName = “SourceSQL”
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script now looping through combinations of a set of arrays.
Weird null error. I have a /lib/task rake script that refuses to set a
I have a script task that executes a dynamically created SQL restore statement. This
I have a C# script task in SSIS that I can pass a variable
I'm trying to programmatically add an Execute SQL task from within a script task
I am looking for an MSBuild task/script that will allow me to control the
I wrote a Python script that does some task to generate, and then keep
I have the following task in my MSBuild script: <Target Name=ZipStates> <Message Text=CREATING ZIP
Essentially I have a script which acts as a task wrapper and emails a
I have an Ant copy task (defined in a Maven script invoked by a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.