I've used the Maintenance Plan Wizard to create a plan. When I execute the plan, the "Maintenance Cleaup Task" fails with this error message:
Executing the query "EXECUTE master.dbo.xp_delete_file 0,N'',N'',N'2016..." failed with the following error: "Error executing extended stored procedure: Invalid Parameter". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Generated T-SQL is this (according to Log File Viewer):
EXECUTE master.dbo.xp_delete_file 0,N'''',N'''',N''2016-01-25T13:50:30''
GO
Please note all single quotes are doubled.
Is there a bug in log viewer or wizard is actually generating invalid T-SQL code?
Just realised that I get "Error executing extended stored procedure: Invalid Parameter" if I remove dupe quotes and run the query manually:
EXECUTE master.dbo.xp_delete_file 0,N'',N'',N'2016-01-25T13:50:30'
GO