How to dynamically determine the amount of worksheet in a workbook for SSIS data load

Posted on 2012-08-30
Last Modified: 2012-08-31
I have an issue where we are on office 2007 and there is a row limit in excel, so the business users are putting data exports in 3 different sheets. The sheets are formatted almost the same, where sheet1 will have the header data, and sheets2, 3, etc will only have the data. Can anybody help me figure out the best way to use BIDS 2008 to dynamically get the number of worksheets in a workbook, then union all the results together?

I was thinking something like this:

IF EXISTS (SELECT something from workbook to get sheets)







Question by:sqlagent007
    LVL 13

    Accepted Solution

    Maybe this post can help.

    Or... You can use variables and a Script Task.

    Inside this task you can code the retrieval of the sheet names, as done in this example.
    Then you can assign the sheet names to the variables you have declared.

    Hope it helps.
    LVL 16

    Expert Comment

    The row limit in 2007 is somewhere about 1,000,000 - it was 65,400 odd in 2003 and before.

    Anyway, where are they getting their data from? I'd bet that they're getting them from some mainframe system that throws out a huge .csv file that they then laboriously chop into pieces to see in Excel, and then you'll have to labour at importing, when you could easily just grab the .csv, import it, and then export it to Excel for them, making their lives easier and your workload go away!
    LVL 1

    Author Closing Comment

    Exactly what I needed! THANK YOU!

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now