How can we Handle Empty Excel File(Data not present except headings) load Through SSIS ?

  • The Business Problem

    To provide some background, the component is being developed for a Finance company

    They provide an excel file of all Revenue & Expense Details filed within the last quarter. This file is replaced every quarter containing all the new Revenue & Expenses from the previous quarter. The name of the Location, its Account, Month Name, & Value Details provided are specified in this file.

    This data is loaded through Scheduled SQL Jobs.

    But If Business provides an empty excel file(File Exists, Column Headings are present but no data), The Scheduled SQL Job using SSIS Package is failing.

    To recap,

    SQL Server Job runs SSIS Package using dtexec command to load the data from excel.

    our SSIS ETL process will accomplish three basic processes:

    Extract

    Read from an Excel file

    Transform

    Adding some default columns and

    Load

    loading into a SQL table

    Please provide a solution...

  • If you are using SSIS to load the data of excel sheet. Put validation before loading the data into database. the job might failed because of empty records.

    Use openrowset in sql task to read it as table and get the count of the records and then move accordingly.

    i hope this helps

    Regards

    Ramu

  • You could add a Conditional Split in the data flow to prevent unwanted records from reaching the database.

    You can also add a Row Count before your database in order to pass the number of records loaded to the Control Flow. You could use the number of records loaded to determine what the proper next step is.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

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

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