Why a simple rename task won't work

  • Hi,

    I was testing file system task to rename a file, and this simple task seemed so difficult to accomplish. I'm getting error such as

    Information: 0xC002F30E at File System Task, File System Task: File or directory "C:\Basura\AAATest.dll" was deleted.

    Error: 0xC002F304 at File System Task, File System Task: An error occurred with the following error message: "Could not find file 'C:\Basura\AAA.dll'.".

    In my File System Task, I've used RENAME, 'overwrite' to true, 'create' file if not existing.

    The source file is already deleted, but the destination file can't be created. Strange...

  • The text you've presented suggests you 1st delete a file and then want to rename it. If a file doesn't exist, how can you expect a rename process to "create it"? What, exactly, would you expect said file to contain? How is either SSIS or SQL Server, or even the operating system supposed to know what the content of the file is supposed to be? Once a file is deleted, it's no longer available to be renamed, so I suspect if you just eliminate the delete piece of your task, you'll be fine.

    Steve

    (aka smunson)

    :):):)

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • I don't think that the delete is the problem as I'm assuming that this is being done with the rename option of a File System Task.

    I'm getting the same problem and can't figure it out at all.

  • Assumptions, assumptions... Why would you bother with a rename option if you were going to delete the file at the same time? It's a really simple problem. If you delete the file, it's not there when you then try to rename it. If you eliminate any attempt to delete the file and just rename the file to begin with, there shouldn't be a problem. Let me know exactly what steps you have and in what sequence they appear...

    Steve

    (aka smunson)

    :):):)

    David Fowler (12/16/2008)


    I don't think that the delete is the problem as I'm assuming that this is being done with the rename option of a File System Task.

    I'm getting the same problem and can't figure it out at all.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • smunson (1/5/2009)


    Assumptions, assumptions... Why would you bother with a rename option if you were going to delete the file at the same time? It's a really simple problem. If you delete the file, it's not there when you then try to rename it. If you eliminate any attempt to delete the file and just rename the file to begin with, there shouldn't be a problem. Let me know exactly what steps you have and in what sequence they appear...

    Steve

    (aka smunson)

    :):):)

    David Fowler (12/16/2008)


    I don't think that the delete is the problem as I'm assuming that this is being done with the rename option of a File System Task.

    I'm getting the same problem and can't figure it out at all.

    The poster is NOT trying to delete the file. SSIS is saying it was deleted when he is trying to rename it.

    I get exactly the same problem. I have two FSO Tasks, one that copies a file and then a 2nd one that tries to rename the copy; only it fails, saying the file was deleted.

    It seems to me that if you set "Overwrite" to True in a RENAME task, SSIS deletes the file. That is not intuitive behaviour; bloody stupid if you ask me.

    Yet if I set "Overwrite" to False in the rename task, the task fails with the other error saying the file does not exist.

    So, how the heck do you get the rename task to do its darn job?

  • It seems that if you have an incorrect path (or no path) specified in the destination for the rename, you can get one of the two errors posted.

    ie file does not exist, or file deleted.

    If you get these, try doing a rename with hardcoded values. Once that works, add your variable and the expression to populate it.

  • I was getting both the errors described above.

    Turns out I was putting the source info in the destination box and visa versa. Sounds so stupid but because the destination information is first I was filing that in with the source info as it's the first thing I think about is "Where is the information coming from?"

    Spent about an hour wondering why it wasn't working. Doh! Just thought I'd share that in case anyone else is having the same problem!

Viewing 7 posts - 1 through 6 (of 6 total)

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