简体   繁体   中英

SQL Server Agent Job - SSIS - C# - “Access denied. ” when trying to delete files

One of our Jobs that runs an SSIS package for deleting files with a script task (c# File.Delete) behaves in a strange way as below. Could anyone help us understand the reason for it?

Below are the basic conditions:
1. SQL Server Agent Service's Logon Account: DomainA\\AAA
2. Owner of the Job: DomainA\\AAA
3. DomainA\\AAA is a member of local "Administrators" group

What we found strange is:
The job fails with the message "Access to the path E:\\XXXX\\pp.csv denied" when Full control access is given only to "Administrators" windows group and successes when Full control access is given directly to "DomainA\\AAA" windows user.

Before the error message above, it says "The step was executed as: DomainA\\AAA".

Version Info:
SQL Server 2008 SP2(10.0.4000)
Windows 2003 R2 x64 SP2

Note:
1. English messages above are my own translation from our language and it wouldn't be accurately equal to the ones in English version.
2. The SSIS package is simplified to have this one script task only for testing.

Can you check weather on the folder you have given all the permission(Read and write) for Administrators group. If this doesn't works please change the folder and try once.

Try this blog to get information about the permission on this directory and file. Hope, this code will help you to find out which permission you need to assign for this user. http://craigot.blogspot.com/2012/09/ssis-checking-filefolder-permissions.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM