Error: ForEach Variable Mapping number 1 to variable "User::SheetName" cannot be applied.

  • Hi everyone,

    I have created a variable "sheetName", to which i have provided a defualt value as the name of the first sheet of my excel file.

    I then added Data flow task into For each loop container, where data flow task contains excel source ,data conversion task and oledb destination .

    I am using 64-bit machine (but i have made "Run64bitruntime" Property to false).

    I am trying to acheive looping through the sheets of a file.I have 3 sheets in my excel file..want to loop through these 3 sheets and get all the data to a common oledb destination .Here in this case my table created for this.

    while configuring For each loop container , i have selected "For each from variable enumerator " . When i run the package ..i get this error :

    "Error: ForEach Variable Mapping number 1 to variable "User::SheetName" cannot be applied "

    Any help would be really appreciated 🙂

    Note :I am using Sqlserver 2008 running in a 64-bit machine .

    Regards

    Chaithanya M

  • Where do you store the names of those 3 sheets?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi ,

    I store sheet names in variable whose scope is at level. I have initilized the first sheet name to the variable.

  • chaithu559 (2/27/2012)


    Hi ,

    I store sheet names in variable whose scope is at level. I have initilized the first sheet name to the variable.

    That's where you store them. But where do they come from? I assume the variable doesn't change value by itself?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • That's where you store them. But where do they come from? I assume the variable doesn't change value by itself?[/quote]

    What do you mean by "where do they come from?"...I didnt get you sir..May be i am silly..But i am a beginner..so has to ask this question.

    Regards

    Chaithanya M

  • Allright, you have an Excel file with 3 sheets.

    You plan to loop over these sheets using a For Each Loop and a variable.

    How are you going to put the names of those 3 sheets into the variable?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I am using expression do acheive this..I had selected and udated servername as Filename in the properties of the connection managers..Do i need to do any thing else

    Regards

    Chaithu

  • Can you post the expression?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • See this documentation on technet...

    http://technet.microsoft.com/en-us/library/ms345182(v=sql.100).aspx

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply