SSIS File System Task to copy a file

  • Hi,

    I have a File System task through which I am trying to copy a file from Source Location to Destination location. The path of source and destination is populated dynamically at runtime in Source and Destination variables respectively. When the File System task is executing it is throwing the error:

    "[File System Task] Error: An error occurred with the following error message: "The filename, directory name, or volume label syntax is incorrect."

    Can anyone please help with the solution for this and let me know If I have missed anything anywhere..

    Thanks in advance,

    Abdul.

  • Try to have a breakpoint before the COPY command and when you reach the breakpoint check the value of your variables.

    Check whether the path are correct

    -Vikas Bindra

  • The Source and destination folders are as follows when i debug,

    Source: "\\\\Localhost\\test\\"

    Destination: "\\\\Localhost\\test1\\"

    though in the DB these are stored as, "\\Localhost\test\" and "\\Localhost\test1\"

  • It is because of the keyword [localhost]. local host will not be recognized by the file system (as far as I know), you will have to use the actual server name.

    Try using the server actual name.

    -Vikas Bindra

  • the LocalHost that I have mentioned here is just for the example. I have given the Fully qualified Server name itself.But still the error is the same.

  • OK. Are you able to copy from the command prompt?

    -Vikas Bindra

  • If possible send to screen shots.Then it is to identify the problem

  • Screenshots would be helpful, but if you know that there are four \\\\ and \\ slashmarks, why not just do a replace on them from the location in which you are setting the parameters?

    --Just for example purposes

    DECLARE @Location VARCHAR(100)

    SELECT@Location = '\\\\LOCALHOST\\AnotherValue'

    --Replace the extra \'s

    SELECT REPLACE(REPLACE(@Location,'\\','\'),'\\\\','\\')

    If you are setting your values via the Script Task, then just

    set your values appropriately.

    VariableName = REPLACE(REPLACE(VariableName,'\\','\'),'\\\\','\\')

    Does this help? If not, how are you setting your values at runtime?

    Brian K. McDonald, MCDBA, MCSD
    Business Intelligence Consultant
    Jacksonville, Florida

  • From the debug window or however you pulled the unc from the package in debug mode the slashes are from the designer and are escape character representations. Your path is correct.

    What I would like to know is how you are executing the package. From the designer or from the command execution. Depending on where the execution of the package happens the program assumes the permissions of the executing account. Example if you are running the package from your machine in debug mode your account used to log into windows is the account used for security. If you executed the package from a sql server task then it would be the SQL account that receives the security permissions.

    I have had 2 problems. 1 the security on the executing account does not have write permissions to the destination directory. The other is that the server is unable to be seen by the client who is writing to the unc destination. If you open a command prompt and ping the server and do not get a valid return then your box does not recognize the domain name in the path. Try the IP. If no packets are returned then your destination is unable to be reached. If that is the case then no way can you get to that destination. If packets are returned using the IP and not the domain name then your DNS is not resolving the domain name correctly. Need to have your It professionals fix this for you.

    Hope that helps a little. Without fully seeing the work flow of the package it is hard to debug. An earlier post suggested trying the copy from the command prompt using the unc path. That is a great suggestion. It falls along the lines of what I mentioned above and you will see the error there as well.

    Jason Monroe

    Direct Group Fulfillment Services

    Senior Programmer Analyst

Viewing 9 posts - 1 through 8 (of 8 total)

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