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 1094999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:03:21+00:00 2026-05-17T00:03:21+00:00

I’m learning SSIS and this seems like an easy task but I’m stuck. I

  • 0

I’m learning SSIS and this seems like an easy task but I’m stuck.

I have a CSV file Orders.csv with this data:

ProductId,Quantity,CustomerId
1,1,104
2,1,105
3,2,106

I also have a stored procedure ssis_createorder that takes as input parameters:
@productid int
@quantity int
@customerid int

What I want to do is create an SSIS package that takes the .csv file as input and calls ssis_createorder three times for each row in the .csv file (the first row contains column names).

Here is what I have done so far.

I have created an SSIS package (Visual Studio 2005 & SQL Server 2005).

In Control Flow I have a Data Flow Task.

The Data Flow has a Flat File source of my .csv file. All of of the columns are mapped.

I have created a variable named orders of type Object. I also have variables CustomerId, ProductId, & Quantity of type int32.

Next I have a Recordset Destination that is assigning the contents of the .csv file into the varialbe orders. I’m not sure about how to use this tool. I’m setting the VariableName (under Customer Properties) to User::orders. I think that now orders holds an ADO record set made up of the contents from the original .csv file.

Next I’m adding a ForEach Loop Container on the Control Flow tag and linking it to the Data Flow Task.

Inside of the ForEach Loop Container I’m setting the Enumerator to “ForEach ADO Enumerator”. I’m setting “ADO object source variable” to User::orders”. For Enumeration mode I’m selecting “Rows in the first table”.

In the Variable Mapping tab I have User::ProductId index 0, User::Quantity index 1, User::CustomerId index 2. I’m not sure if this is correct.

Next I have a Script Task inside of the ForEach Loop Container.

I have ReadOnlyVariables set to ProductId.

In the Main method this is what I’m doing:

 Dim sProductId As String = Dts.Variables("ProductId").Value.ToString

 MsgBox("sProductId")

When I run the package my ForEach Loop Container turns Bright Red and I get the following error messages

Error: 0xC001F009 at MasterTest: The type of the value being assigned to variable "User::ProductId" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Error: 0xC001C012 at Foreach Loop Container: ForEach Variable Mapping number 1 to variable "User::ProductId" cannot be applied.
Error: 0xC001F009 at MasterTest: The type of the value being assigned to variable "User::Quantity" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Error: 0xC001C012 at Foreach Loop Container: ForEach Variable Mapping number 2 to variable "User::Quantity" cannot be applied.
Error: 0xC001F009 at MasterTest: The type of the value being assigned to variable "User::CustomerId" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
Error: 0xC001C012 at Foreach Loop Container: ForEach Variable Mapping number 3 to variable "User::CustomerId" cannot be applied.
Warning: 0x80019002 at MasterTest: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (12) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Package.dtsx" finished: Failure.
     Dts.TaskResult = Dts.Results.Success

Any help would be appreciated

  • 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-17T00:03:22+00:00Added an answer on May 17, 2026 at 12:03 am

    One of my coworkers just give me the answer.

    You don’t need the the ForEach Loop Container or the RecordSet Container.

    All you need is the Flat File Source and an OLE DB Command. Connect to your database and inside the OLE DB Command select the appropriate connection.

    In the Component Properties enter the following SQLCommand:

    exec ssis_createorder ?, ?, ? 
    

    The “?” are place holders for the parameters.

    Next under the Column Mappings tab map the .csv file columns to the stored procedure parameters.

    You are finished go ahead and run the package.

    Thanks Gary if you were on StackOverFlow I would give you an upvote and accept your answer.

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

Sidebar

Related Questions

No related questions found

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.