File System Task

  • I have a simple File System Task to just delete a file. It works fine when I run the task in the BI Studio. But when I run it from Management Studio as a Job (I'm using File System) it get a message like this. I've tried the Copy file and Delete directory content operations with the same results.

    Error: 2008-04-14 15:36:48.92 Code: 0xC002F304 Source: File System Task File System Task Description: An error occurred with the following error message: "Access to the path 'D:\DBInfo.txt' is denied.". End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 3:36:08 PM Finished: 3:36:50 PM Elapsed: 42.344 seconds. The package execution failed. The step failed.

    I've put the account that runs the SQL Agent in the Administrators group on the server. I tried using the Script Task too. I'm using SQL Server 2005 9.0.3054. What am I overlooking?

    Terrie

  • Terrie, check the permissions on the D: drive - even though the account running the SQL Agent is a member of the local admins group, you can still have insufficient rights to write to a directory in some cases (even though as an admin you can change those rights). If the account has rights to log in locally, try logging in and manually writing to the target directory.

    The only other thing I can think of is that another process could have locked the file, but I would expect that the error message would read differently.

    Let me know how it goes....

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Also make sure you don't have the file open from your workstation.

  • Hi... had the same problem, had full access for the sql agent to the file share so the job could read the file but couln't delete it. Worked when I gave the sql agent account access to the folder itself

  • Follow Arnar's post, and the post above it, they will solve the prob.

    If u are using a proxy account to run the job, then give the credential (Windows AD account) necessary permissions on the drive or folder.

  • Sorry for bumping this but I am having the exact same issue. Running a Delete Directory Contents task - however in my case it fails in both BIDS and through SQL Agent. Both running as local admin and local admin has full permissions to the directory. Am I missing something obvious?

  • When you say that it failed, is there a specific error message you receive? Most of the time if it works in dev but not after deployment, you're dealing with a permissions issue. If it's not working even during development, you may have another issue such as an invalid path.

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • did you ever get an answer on this, mine was working fine, now all of a sudden im getting

    [File System Task] Error: An error occurred with the following error message: "Access to the path 'U:\List\List\Selections FOPL\HC Proms' is denied.".

  • I never could get Delete to work. I took a different approach using Rename and that works. Since I originally posted this I've added SQL2008 servers to my queendom. For those I'm using a Script Task to delete aged files and that works just fine. I've not tried Delete from the File System Task on SQL2008 yet.

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

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