SSIS : Cannot open the datafile

  • Hi,

    If I run the package from BIDS, it works fine. If I run the package inside Management Studio it works when I run it as a package.

    It does NOT run when I schedule the job.

    Error: 2008-03-12 10:51:56.16

    Code: 0xC020200E

    Source: Data Flow Task Flat File Destination [194]

    Description: Cannot open the datafile "D:\old_timesheet_repos\TimeSheet\files\date.txt". End Error

    Error: 2008-03-12 10:51:56.16

    Code: 0xC004701A

    Source: Data Flow Task DTS.Pipeline

    Description: component "Flat File Destination" (194) failed the pre-execute phase and returned error code 0xC020200E. End Error

    DTExec: The package execution returned DTSER_FAILURE (1).

    Started: 10:51:55 AM Finished: 10:51:56 AM Elapsed: 0.344 seconds.

    The package execution failed. The step failed.,00:00:01,0,0,,,,0

    Any idea?

    Thanks in advance.

    Eric.

  • I was able to fix the issue by giving full control to the 'users' group to the text file.

  • Hi,

    This issue normally comes up when the corporate policy hardens the servers thereby causing many security issues.

    Many a times even granting full control to the user account under which the package runs, does not resolve the error. So what you will have to do is add the user under whose account the package runs to the destination servers "Power Users group". This will give some permissions to the user account and resolve the security issues.

    Best Regards,

    Hitesh

  • Thank you, I came up with the same issue. but got it resolved by your post.

    Thank you,

    Anilkumar

  • anil.kumars13 (8/16/2013)


    Thank you, I came up with the same issue. but got it resolved by your post.

    Thank you,

    Anilkumar

    Remember that you now gave everyone full access to your data in the file.

    Just sayin'...

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • thanks for sharing the information

    so, what we have to do to give access to particular user, who can run the job as well.

    Thank you,

    Anilkumar

  • anil.kumars13 (8/16/2013)


    thanks for sharing the information

    so, what we have to do to give access to particular user, who can run the job as well.

    Thank you,

    Anilkumar

    Use proxies in the SQL Agent job.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (8/16/2013)


    anil.kumars13 (8/16/2013)


    Thank you, I came up with the same issue. but got it resolved by your post.

    Thank you,

    Anilkumar

    Remember that you now gave everyone full access to your data in the file.

    Just sayin'...

    Joen, can you elaborate how does everyone get access to the data, when only the specific user under whose account the package is run is added to power Users group? Does'nt seem to make a point..

  • hitesh.ramchandani (8/16/2013)


    Koen Verbeeck (8/16/2013)


    anil.kumars13 (8/16/2013)


    Thank you, I came up with the same issue. but got it resolved by your post.

    Thank you,

    Anilkumar

    Remember that you now gave everyone full access to your data in the file.

    Just sayin'...

    Joen, can you elaborate how does everyone get access to the data, when only the specific user under whose account the package is run is added to power Users group? Does'nt seem to make a point..

    I wasn't referring to your post, but to the post by Eric:

    I was able to fix the issue by giving full control to the 'users' group to the text file.

    Doing this gives everyone who is a user full access to the data in the file.

    It's much saver to use proxies in the SQL Agent job and give that proxy account specific permissions on that file/directory.

    Even adding the proxy account to the Power User group might be insecure, as you're giving that account potentially too much permissions.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Hi All,

    I have a SSIS package which get the result from a query and dumps that in a TXT file.

    It runs well in BIDS. But when I scheduled this as SQL Agent job it fails saying "Cannot open the datafile "C:\SSIS\File_09112013.txt". End Error Code: 0xC004701A "

    I have a variable which holds the filename "C:\SSIS\File_09112013.txt".

    What is the solution for this?

    Please suggest.

    Thanks

  • Does the SQL Server Agent account have permissions to open the file? Or are you using a proxy?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I had this error. In my case, I had the wrong selection in the For Each Loop container. Under collection there are three options:

    name and extension

    fully qualified

    name only

    I made changes to a variable, and that impacted how the loop was reading the file name. After I updated the For Each Loop option, my package worked without an error.

  • Have given all types of permissions, but no luck. Can someone help in resolving the error?

    Error: [SSIS.Pipeline] Error: Read From CSV failed the pre-execute phase and returned error code 0xC020200E.

  • bheema.ece12 (11/13/2016)


    Have given all types of permissions, but no luck. Can someone help in resolving the error?

    Error: [SSIS.Pipeline] Error: Read From CSV failed the pre-execute phase and returned error code 0xC020200E.

    Does the file you are reading from exist? If so where and where are you running the package from? Your machine or on another machine?

    ----------------------------------------------------

  • Hi Martin,

    The file is stored on my machine and both DB and SSIS packages are running in my local machine itself.

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

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