Missing user defined variable in the Script Task Editor

  • Using SSIS 2008, having problem in the Script Task Editor, under ReadOnlyVariable, hit the ellipse button but

    my user defined variable is not showing up, only system variables.

    On the Data Flow Tab, Excel Source connected to the RowCount. Double click on RowCount and the Editor for

    Row Count appears and at bottom for Variable Name, hit the ellipse button and I find the user defined variable

    I created.

    On the Control Flow Tab(I did this first), Data Flow Task. I tested what I have to this point and everything

    worked out because the Row Count return 100 rows.

    Then I drop a Script Task on the Control Flow, connected the Data Flow Task to the Script Task. Double click

    on the Script task, and the editor window appeared. When I hit the ellipse button on the ReadOnlyVariable, I

    only see the System variables and NOT my user defined variable. I was able to see it under the Data Flow

    Tab, but not on the Control Flow tab.

    I do not know what I am missing.

    Thanks.

  • Check the scope of the variable.

    To keep it safe, I usually keep the scope of all the variables as package wide.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • I was able to make my variable global. My Script task has a Message.Show with the variable. Example,

    The number of rows are (then the variable results). However, my variable here is zero and it should read

    101. When I execute my package, in the Data flow tab, I see the "101 rows" between Excel Source and

    the Row Count. But the 101 is not making it to the Script task, Simple code:

    MessageBox.Show("There are " + Dts.Variables["NumberRows"].Value + " rows");

    NumberRows is my variable.

    Also, I am getting the following warning for each of my column headings from Excel workbook

    and how do I correct it:

    [SSIS.Pipeline] Warning: The output column "Id" (41) on output "Excel Source Output" (9) and component "Excel Source" (1) is not subsequently used in the Data Flow task. Removing this unused output column can increase Data Flow task performance.

    Thanks,

    rtp

Viewing 3 posts - 1 through 2 (of 2 total)

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