SSIS Writing to open file. RRS feed

  • Question

  • I need to write lines of data to a text file that is already open.  To make a long story short, this is a Windows ERP application that reads the file for changes and then writes the data to it's SQL database.  My SSIS package will write data to the file when it is not opened. My VB6 applications written by the ERP vendor write lines directly to the file successfully so it must be open in some sort of shared fashion. I just need to have SSIS write to it without requiring a lock.   There is no reliable method to write directly to SQL (business logic is in the ERP app).
    Monday, April 19, 2010 6:14 PM


  • Hi,

    If you use SSIS Flat File Destination, it will lock the file to write it. There is no other option. The only method is to write your own text writer and try to write without locking. (I am afraid it may not be possible too.)

    So, go to your vendor which wrote VB6 application, ask them to add a feature to postpone VB6 insertion process if file is locked. Maybe they implement "retry and wait until file is unlocked"

     Hope this helps



    BI and ERP Senior Consultant @ Nexum Bogazici Personal Blog: http://www.ssisnedir.com/blog - If it is, Please dont forget to mark as answered or at least vote as helpful if the post helps you in any ways.
    • Proposed as answer by Onur Omer Ozturk Sunday, April 25, 2010 8:52 PM
    • Marked as answer by Zongqing Li Tuesday, April 27, 2010 6:57 AM
    Saturday, April 24, 2010 5:54 PM