Assigning values to variables from derived column
hi, could you please let me know the below scenario: i have 3 columns in the derived column transformation (these 3 column values have only a single date, total count, total record count information) and i need to assign these 3 to respective 3 variables in the package, i thought of going with the script component transformation and assigning the values for variables from derived column values. let me know how we can proceed. for script task could you let me know the script as i dont know .nt / c#
February 16th, 2011 9:32am

Hi, The first step is have the variables created in scope you need. The second step in use a Script component to asign column values to variables: Configure Script component, enter to editor and fill custom properties, ReadWriteVariables property. Here set your variables. After this push on Edit Script and go to Input0_ProcessInputRow and write this code: Variables.VariableForDate = Row.DateColumn; Variables.VariableForTotal = Row.TotalColumn; Variables.VariableForCounter= Row.CounterColumn; and done!Vctor M. Snchez Garca (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2011 9:47am

Where ae you getting the input data from? Why I ask this is, incase the source is a table you could dirctly write a query in Execute SQL task and assig the values in the control flow itself. In case that is not the case you would have to go with Script component as Deived column does not hae thatfeature. have a look at my blog.My Blog | Ask Me
February 16th, 2011 11:12am

Victor, i am getting the error when i am writing variables.<myvariablename>, the error is variables doesnot exist in current context. raj, i am getting the data from a derived column where i want to store in the variables.
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2011 12:42am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics