Answered Calculation in a loop

  • Thursday, March 07, 2013 9:09 PM
     
      Has Code

    Hi, I'm brand new to SSIS so this is probably a very basic question.  I need to loop through several million numbers and perform a calculation on the number using a custom c# method and then store the results in a table.  Is SSIS a good tool for this and can anyone please lead me in the right direction for setting something like this up?  All of the examples I have found refer to reading data from a location, doing something with it, and then storing is somewhere.  I don't want to read data from a source, I just want to use the loop index as my data for the calculation and then store the result in a table.  As an example, I'm looking for something like this:

    for(int i = 1; i < 50000000; i++){
       int result = MyCalculationMethod(i);
       //each time through the loop, the result should be stored as a new row in my table
    }
    I have a WinForms application that is doing this, but it is too slow.  I'm trying to figure out if SSIS is a better option.  Any help is greatly appreciated. Thanks.

All Replies

  • Thursday, March 07, 2013 9:29 PM
    Moderator
     
     Answered

    If you don't want to loop through a table (or an other source) but just doing a calculation a couple of X-times then I doubt SSIS is suitable(/better than winforms) for the job...

    Perhaps you could you give an example with a couple of sample records?


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter

  • Friday, March 08, 2013 7:00 AM
     
     

    Hi Dude,

    Can you let us know what is the source of this million records ? is it like Flat file, excel sheet or database.

    Regards

    Naveen