SiSS error handling for a flat file in use

  • Hi,

    I am currently developing a SiSS package to import multiple flat CSV files into a database using a forloop Container.

    I have this working..:-)

    :angry: However there is a possibility that one of the files could be in use at the time the SiSS pack is executed and I want to ignore this file, log the error and move on to the next file.

    But I am unsure how to handle the error. I would very much appreciate someone pointing me in the right direction

    Apologies if this is the wrong forum.

    B

  • One way is via a script task or process task, before trying to use the file test if it is locked and only proceed if it isn't.

    There is a whole load of caveats around this as it all depends on how the file is locked. For example you have a process that continuously Opens, appends and closes the file and then repeats. You may find that when the test is evaluated the file is unlocked but when you try and read it its locked.

    This thread gives you a few options to do it via C# or via powershell.

    http://stackoverflow.com/questions/1304/how-to-check-for-file-lock

    MCITP SQL 2005, MCSA SQL 2012

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

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