SSIS Package To Check for a Flat file And Return True/False

Posted on 2009-04-16
Last Modified: 2013-11-30
Hi Experts, I have to create an SSIS Package to Check If a Specific File Exists in a Folder. If this File Exists then it should return True and if it dosent exist it should return False. What I have to do actually is, I have to Schedule a Sql Agent job in that the first step is to check if a file (filename_04152009_1515) exists in a folder on my network, and if this file exists I have to Proceed to the next step and if this file dosent exist, I have to send a mail to the User telling that the data file is not there, please help me Thanks in Advance.
Question by:KuldeepReddy
    LVL 16

    Expert Comment

    Can the generation of this file take some time?  If so you can check to see if it exists but if it is still being generated/created and/or open/locked by someone just checking to see if it exists will not work.

    If it is still being generated or locked your process when run will error out (I know I have a similar issue trying to see if a file is done or not).

    Just something to keep in mind when doing this.


    Author Comment

    There are some jobs that runs every day.
    Job1: This job gets some text files from an external source and puts these files in folder on the network
    Job2: This is an SSIS job that gets data from the thext files and loads into some tables
    Job3: A report is run on the SSRS and an Excel file will be shaved  on my shared folder.
    Job4: this has to be created now, What I want to do is I just want to check If a specific file exists in the folder(that came in through Job1) CASE1: if this file exists, I want to run a batch job that renames my report on the shared drive and then email  out the report from my shared folder.
    CASE2: If the Specific file is not there in the Folder (that came in through Job1) I want to send out an email that says "Theres no data for the report".
    The Purpose of checking wether a specific file exists in the folder is just to confirm that the report has data since data in this file is used for the report.
    LVL 22

    Accepted Solution

    Check the attached project I made for you.
    Add the attached package to an existent SSIS colution, update the connection in Connection Managers and run...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    759 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

    9 Experts available now in Live!

    Get 1:1 Help Now