Add new record

  • Hi..New to SSIS.

    I have a flat file that has two fields. One is productcode, one is quantity.

    All I want to do is if productcode = 'GM-Hello-1' then I want to add another line that says 'GM-Hello-2'with a quantity.

    Its because the two products are in a pack but only one is added to the order.

    Many thanks in advance

    Scott

  • Hi,

    Could you give a little bit more  information regarding this? I am of the impression that you need to only added new record if GM-Hello-1 specifically exists in the flat file. Or is that there could be more products that have -1 suffixed?

    Regards

     

  • Yes..I only want to add another record if the specific code exists. This is due to us sending out a book but the pack actually contains two books. So I need to see the stock movement.

    I have done this through an insert statement but its run against the actual table. I would prefer to know the way to complete this in SSIS.

    My update statement as follows;

    INSERT INTO GMCPUBS.dbo.JDWilliamsTemplate ([Stock Code], [Quantity])

    SELECT 'ST-MEMORIES-10', [Quantity]

    FROM dbo.JDWilliamsTemplate

    WHERE [Stock Code] = 'ST-MEMORIES-1'

    Many thanks

    Scott

  • Hi Scott,

    You could use a conditional split - i.e split out all the rows that have the value you are looking for in the product field - then pass that reduced recordset to a task to insert the records you need into the DB.

    HTH,

    Catherine


    Kindest Regards,

    Catherine Eibner
    cybner.com.au

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

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