• --Had problems with file delete,. which turned out to be the format of the date provided to the routine

    --

    declare@del_datechar(8)

    set@del_date = convert(char(8),getdate()-2,112)

    exec master.dbo.xp_delete_file 0,'c:\temp','bak',@del_date,1