Urgent! Assigning a value to SSIS package variables

  • Hi,

    I am converting DTS to SSIS, in DTS there are 3 package global variables & dataflow task which is taking data from CSV file into table, our requirement is that we have to assign the value from the csv file to package variables which is passed to stored procedure as a parameter, in DTS they have used the following code

    DTSGlobalVariables("as_of_date").Value = Trim(DTSSource("Col001"))

    DTSGlobalVariables("file_type").Value = Trim(DTSSource("Col013"))

    DTSGlobalVariables("product_type").Value = "BBLN"

    In SSIS I have taken a Script component & wrote in following way

    Dts.Variables("as_of_date").Value = Trim(Col001)

    but it gives syntax error like blue underline in Dts

    Can any one help me that how to write this in SSIS or suggest any other way?


  • It's unclear from your question if need to assign a value to a variable in the control flow. Assuming you are, you may want to use the "Execute SQL" task, query the table and assign the results to the variables. I can give you a more detailed example, just let me know if this is your intention.

  • Hi,

    Thanks for your reply!

    I got the solution, I have writen the code as below

    Me.ReadOnlyVariables("as_of_date").Value = Trim(Row.Column0)

    and set the ReadOnlyVariables property of Script component Task with variable name (as_of_date)


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

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