locked
Export To Excel RRS feed

  • Question

  • Hi All,

    I have an excel file with large amounts of record which has a column like 'Group'.

    Now i want to create excel file for each data exists in Group column.

    Please suggest how can i do this in SSIS ?

    Regards,

    Ibrahim Khan

    Wednesday, July 10, 2013 7:37 AM

Answers

  • Hi,

    Please select the distinct 'Group' values into a SSIS object variable.

    And loop through Each group(For each loop container) and The data flow task source should filter for this group only and store the records in excel.


    Rajkumar

    • Proposed as answer by V Karthik Thursday, July 11, 2013 11:10 AM
    • Marked as answer by Mike Yin Thursday, July 18, 2013 9:46 AM
    Wednesday, July 10, 2013 9:36 AM
  • Read the Group column with an Excel Source component. After that, use a SORT component on the GROUP column and at the bottom choose to remove duplicates. Write the results to the new Excel file using the Excel Destination component.

    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

    • Proposed as answer by Koen VerbeeckMVP Thursday, July 11, 2013 11:28 AM
    • Marked as answer by Mike Yin Thursday, July 18, 2013 9:46 AM
    Thursday, July 11, 2013 6:16 AM

All replies

  • Hi,

    Please select the distinct 'Group' values into a SSIS object variable.

    And loop through Each group(For each loop container) and The data flow task source should filter for this group only and store the records in excel.


    Rajkumar

    • Proposed as answer by V Karthik Thursday, July 11, 2013 11:10 AM
    • Marked as answer by Mike Yin Thursday, July 18, 2013 9:46 AM
    Wednesday, July 10, 2013 9:36 AM
  • Hi Ibrahim,

    You want findout the List of Distinct value in the GROUP Column in you excel file ?

    you get the data two different ways

    1) Using Execute SQL Task and point it to Excel file source and right an

    Query : SELECT Distinct  Ground FROM  [sheetName$]

    Result Set : Full

    result Set : Map object type variable.

    After this execute you distnict data will be stored in that variable. now, you loop thourgh and create file based on that.

    2) Using Data Flow Task

    Source : Excel File and get the Distinct for group 

    Destination : Recordset Destination and Map object type variable

    After this execute you distnict data will be stored in that variable. now, you loop thourgh and create file based on that.

    Thanks,

    Naveen T


    Naveen Kumar

    Thursday, July 11, 2013 3:18 AM
  • Read the Group column with an Excel Source component. After that, use a SORT component on the GROUP column and at the bottom choose to remove duplicates. Write the results to the new Excel file using the Excel Destination component.

    MCSE SQL Server 2012 - Please mark posts as answered where appropriate.

    • Proposed as answer by Koen VerbeeckMVP Thursday, July 11, 2013 11:28 AM
    • Marked as answer by Mike Yin Thursday, July 18, 2013 9:46 AM
    Thursday, July 11, 2013 6:16 AM