Sunday, March 11, 2012

Can''t Delete Maintenance Report Files (txt) in SQL/2005

I have several maintenance plans setup and working in SQL/2005 (sp2 9.0.3042) on several servers; however, the .txt maint plan output files will not delete on any of the servers. The backups run fine, the old database and transaction log backup files delete fine (.bak and .trn); but, the .txt files won't go away unless I delete them by hand. I tried copy/paste the scripted command (xp_delete_file) and it runs with no errors but does not delete the old .txt files. ( This server was upgraded from SQL/2000 -

EXECUTE master.dbo.xp_delete_file 1,N'E:\Program Files\Microsoft SQL Server\MSSQL\LOG\',N'txt',N'2007-07-09T10:59:38'

)

I do NOT specify a period (.) in the file extension dialog box. Any ideas before I setup a .cmd batch file and schedule it instead?

Thanks in Advance,

DeWayne

did you create a maintenance clean up task and specify the .txt file extension to delete old text files ? but xp_delete_file is corresponding T_SQL of the cleanup task............if you hevent created the cleanup task just try it out and get back

|||

Yes! That's where I got the xp_delete_file script that I quoted in my original post...as it does not delete any .txt files.

Thanks

|||

Same problem here. Is there any hotfix to address this issue?

|||Same here - I've tried on several SQL 2005 servers and none of them delete the .txt files. Any ideas?
|||Same for me, anyone from MS like to comment on this?|||

There is a support article on the subject, http://support.microsoft.com/kb/938085. The problem appears to be the first line of text in the report files. If it says "NEW COMPONENT OUTPUT", then xp_delete_file will not delete it. The stated workaround is to remove this text. That does work, but it's probably simpler to just manually delete the file. Hope a fix comes out soon.

No comments:

Post a Comment