Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get this error:

Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'\\SQLSvr..." failed with the following error: "xp_delete_file() returned error 2, 'The system cannot find the file specified.'". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

The server is running SQL Server 2008 R2 doing backups on one server to save to a remote server using UNC paths; file extension is ".bak".

share|improve this question
up vote 5 down vote accepted

Much as the error message states, it can't find the file N'\\SQLSvr..."

If you know the file does exist, then that usually points to a permission problem with either the account SQL Agent is executing as or if you've created it, a credentials proxy account. Either way, it can't access the network share or it does not have permission to perform the delete operation.

I'd first verify the account can access the share, then look at folder permissions and ensure it has delete privilege.

share|improve this answer
you're right. thanks. what threw me off was the fact that since it backups up to a different server using the same account i had set it up with, it should have been able to cleanup too using those same credentials. anyways on the share and the ntfs, i added the server/computer(destination) itself to the security permissions with full control and that did it. thanks again! – shilezi Oct 22 '13 at 13:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.