Step 5: Save the Script and Run your SSIS Package to load data to multiple Excel Sheets from SQL Server Table by splitting depending upon number of rows

Save the script and close the windows. Your SSIS Package is read to read data from SQL Server table and will split to multiple sheets depending upon the total number of records and RecordsCntPerSheet variable value.

I execute my package after setting the RecordsCntPerSheet value=3. I had total 11 records in my table. It create an excel file with 4 sheets as can be seen below. First three sheets will have three records and 4th will have only 2 records.

How to split large table data to multiple excel sheets by using SSIS Package- Script Task

Check out video demo how to split large data into multiple excel sheets on single excel file.