December 18, 2011 at 11:51 pm
I am trying to delete files through SQL Server 2005 T-SQL. But getting “Access denied” error. Tried both windows user and sa user to do this. Both case users were sysadmin. I can delete these files manually. So, permission is there. Is there anything else I have to do?
Please help me to sort out this issue or please direct me to the links if already any solutions available.
Please find the delete script below and attached screen shot of the error.
DECLARE @lPath VARCHAR(1000)
SET @lPath = 'D:\DB\Backup\ddd\*.txt'
SET @lPath = 'del ' + @lPath
EXEC xp_cmdshell @lPath
_____________________________________________
One ounce of practice is more important than tonnes of dreams
December 19, 2011 at 12:39 am
Looks like your SQL Server service account has no permission to delete.
December 19, 2011 at 1:25 am
Suresh B. (12/19/2011)
Looks like your SQL Server service account has no permission to delete.
Thanks Suresh for the reply.
Where do I can do the changes to provide the permission?
_____________________________________________
One ounce of practice is more important than tonnes of dreams
December 19, 2011 at 1:36 am
Folder security property...
Right click on the folder->Properties->Security->Edit->Add...
December 19, 2011 at 1:40 am
Suresh B. (12/19/2011)
Folder security property...Right click on the folder->Properties->Security->Edit->Add...
Suresh, Thanks TON :). It's workingggg...
_____________________________________________
One ounce of practice is more important than tonnes of dreams
December 19, 2011 at 2:05 am
Thanks for informing that it worked.
Happy to know that your issue is resolved. 🙂
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply