Weird happenings with master.dbo.xp_delete_file

  • I created a task to delete any backups older than 12 hours from disk; the task is using the master.dbo.xp_delete_file stored procedure. Just recently, my maintenance plans started failing on just one of my servers, the rest of them are fine. The plan is failing on the master.dbo.xp_delete_file step. When I generate the tsql and run it through SSMS, I get the following error: "A severe error occurred on the current command. The results, if any, should be discarded." And what is evener weirder is that my session will become completely disconnected. I can run the tsql command from any other server just fine.

    It is a SQL 2008 SP2 server.

    The tsql looks like this: EXECUTE master.dbo.xp_delete_file 0,N'\\servername.com\sqlbackup\dev\2008',N'bak',N'2011-06-21T21:07:59',1

    Any ideas?

  • The extended stored procedure is undocumented and unsupported, and there must be a reason... 😉

    Take a look at this post by Andy Leonard, it should shed some light.

    -- Gianluca Sartori

  • Gianluca Sartori (6/22/2011)


    The extended stored procedure is undocumented and unsupported, and there must be a reason... 😉

    Take a look at this post by Andy Leonard, it should shed some light.

    Yeah, I've already read that article. He still uses it though to delete files. I guess I need to develop an alternative...maybe in Vbscript...hmm

  • What about powershell?

    -- Gianluca Sartori

  • Gianluca Sartori (6/22/2011)


    What about powershell?

    True. I always forget about Powershell. I've learned how to use it, but have not had a chance to leverage my skills. Thanks!

Viewing 5 posts - 1 through 4 (of 4 total)

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