import to multiple excel files

  • Hi

    I have a query with the fields: unitname, pointname, point description

    as:

    worthington,anderton,comms status

    smithfield,waverley, boot status

    islignton, shenfield, exit status

    Select unitname, pointname, pointdescription

    from production

    I would like to a SSIS package so what when the package is run for each change in name of unitname, the details are exported to an excel file.

    e.g.

    first file would be named worthington.xls second named smithfield.xls

  • Here's one approach:

    (1) SELECT DISTINCT unitname FROM production

    (2) Loop through that result set something like this:

    SELECT pointname, pointdescription

    FROM production

    WHERE unitname = ?

    (3) Export the result of (2) to an Excel workbook called ?.xls

    John

  • you can go with Foreach Loop container to pick each diffrent set and write to an excel file.

  • Thanks Guys. Can anyone point me to any specific examples. Much appreciated.

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

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