Quantcast
Channel: Answers for "Please provide a script which will delete old back"
Browsing latest articles
Browse All 14 View Live

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 Article


Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer by KenJ

It's always fun to throw out a CMD version... forfiles /P /S /D -1 /C "cmd /c del /q @path"

View Article


Answer 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 Article

Answer 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
Browsing latest articles
Browse All 14 View Live