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

  • Home
  • SEARCH
  • 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 5961875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:01:38+00:00 2026-05-22T19:01:38+00:00

I’m trying to execute a sql script using the task in SSIS. My script

  • 0

I’m trying to execute a sql script using the task in SSIS.

My script just inserts a bunch of nambe value pairs in a table. For example –

insert into mytable (name, value)
values
(?, ‘value1’),
(?, ‘value2’)

Now, I want to map a variable defined in SSIS to be mapped to the parameters in the statement above. I tried defining a scalar variable but I guess the sql task doesn’t like that. Oh and all the name parameters in the insert statement resolve to a single variable.

For example I want
insert into mytable (name, value)
values
(‘name1’, ‘value1’),
(‘name1’, ‘value2’)

When I open the Parameter Mapping tab for the task, it wants me to map each parameter invidually like –

Variable Name – User::Name
Direction – Input
Data Type – LONG
Parameter Name – 0
Parameter Size – -1

Variable Name – User::Name
Direction – Input
Data Type – LONG
Parameter Name – 1
Parameter Size – -1

This quickly gets out of hand and cumbersome if have 5-10 values for a name and forces me to add multiple assignments for the same name.

Is there an easy(-ier) way to do this?

  • 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-05-22T19:01:39+00:00Added an answer on May 22, 2026 at 7:01 pm

    The easiest (and most extensible) way, is to use a Data Flow Task instead of using an Execute SQL Task.

    1. Add a Dataflow Task; I assume that you have all the variables filled with the right parameters, and that you know how to pass the values onto them.
    2. Create a dummy row with the columns you will need to insert, so use whatever pleases you the most as a source (in this example, i’ve used an oledb connection). One good tip is to define the datatype(s) of each column in the source as you will need them in your destination table. This will align the metadata of the dataflow with the one the insert table (Screenshot #1).
    3. Then add a multicast component to the dataflow.
    4. For the first parameter/value, add a derived column component, name it cleanly and proceed to substitute the content of your parameters with your variables.
    5. For each further parameter/value that needs to be added; copy the previously created derived column component, add one extra branch from the multicast component and proceed to substitute the column parameter/value as necessary.
    6. Add a union all and join all the flows
    7. Insert into the table
    8. Voilà! (Screenshot #2)

    The good thing about this method is that you can make as extensible as you wish… validate each value with different criteria, modify the data, add business rules, discard non-compliant values (by checking the full number of complying values)… !

    Have a nice day!

    Francisco.

    PS: I had prepared a couple more screenshots… but stackoverflow has decided that I am too new to the site to post things with images or more than two links (!) Oh well..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

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.