|
I want to delete files from backup activities using xp_delete_files, I created a new maintenance plan to delete *.bak and *.trn files. Both doesn't work and no error message is generated. The T-SQL statement being made is: When I run it in a query window using my own account it fails as well without a message. I checked The instance is version 9.0.3080 SP2 standard edition on a 64 bit platform.
(comments are locked)
|
|
You need to have sysadmin privileges - can you confirm that you are running the maintenance plan with a user with those rights, and that when you try it in a query window you have the right privileges. Thanks for your responce but I checked it and I have sysadmin. I used: SELECT SSP.name AS [Login Name], SSP.type_desc AS [Login Type], UPPER(SSPS.name) AS [Server Role] FROM sys.server_principals SSP INNER JOIN sys.server_role_members SSRM ON SSP.principal_id=SSRM.member_principal_id INNER JOIN sys.server_principals SSPS ON SSRM.role_principal_id = SSPS.principal_id; to check my server role, and is is sysadmin. Sorry for the mess but I can''t change it.
May 27 '10 at 09:54 AM
Rob 2
(comments are locked)
|
|
The joys of using undocumented commands. https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124708&wa=wsignin1.0 However, there is some useful information here: http://sqlblog.com/blogs/andy_leonard/archive/2009/03/11/xp-delete-file.aspx - this link shows a further parameter that your code doesn't have. Perhaps this is the problem?
(comments are locked)
|


When I try to delete 1 specific file I get: Executed as user: admin-vos. xp_delete_file() returned error 5, 'Access is denied.' [SQLSTATE 42000] (Error 22049). But I can delete the file using the explorer.