Answer by Cyborg
I have a solution using XP__CMDSHELL_, I know enabling XP_CMDSHELL is a security risk.... Sorry!. -- Use this script inside your Job DECLARE @SQL VARCHAR(800), @ID INT, @MaxID INT, @BackupPath...
View ArticleAnswer by WilliamD
You could also try using VBScript - [@ThomasRushton has an example on his Blog][1] [1]: http://thelonedba.wordpress.com/2010/10/18/sql-server-2005-rtm-maintenance-cleanup-fail/
View ArticleAnswer by Leo
Hi, You don't need to write a script to delete your backup file. you can set the maintenance plan to do it. There is called 'Maintenance CleanUp Task'.
View ArticleAnswer by Grant Fritchey
What, no one is using PowerShell? First attempt, this seemed to work: Get-ChildItem c:\backup | where {$_.LastWriteTime -lt (Set-Date -Date (Get-Date).AddDays(-1))} | Remove-Item
View ArticleAnswer by KenJ
It's always fun to throw out a CMD version... forfiles /P /S /D -1 /C "cmd /c del /q @path"
View ArticleAnswer by ramesh 1
i think this helps you very well Option Explicit 'Delete all SQL Server backup files more than 1 days old Dim oFS, oSQLBackupFol, oFol, oFil Set oFS = CreateObject("Scripting.FileSystemObject") Set...
View ArticleAnswer by Jason Cumberland
Try using this procedure. It is an undocumented procedure from MS so the functionality could break during an upgrade or SP, but I find that risk easier to deal with than enabling xp_cmdshell or SSIS...
View Article