winoob.blogg.se

What files can be deleted with sql 2012 express
What files can be deleted with sql 2012 express











what files can be deleted with sql 2012 express

'Delete any old BACKUP files to cleanup folder If DateDiff ( "d", itemFiles.DateCreated, Now ()) >= 3 Then 'check if the database backups are older than 3 days 'file extension using the GetExtensionName method 'retrieve complete path of file for the DeleteFile method and to extract 'iterate thru each of the files in the database backup folder Write " TIME: " & FormatDateTime ( Now (), 3 ) & "" & VBCRLF & VBCRLF Write " DATE: " & FormatDateTime ( Now (), 1 ) & "" & VBCRLF Write " DATABASE BACKUP FILE REPORT " & VBCRLF Set objFile = fso.OpenTextFile ( sFolder & "\scripts\LOG.txt", ForAppending ) 'a file inside it named "LOG.txt" for delete activity logging 'you need to create a folder named "scripts" for ease of file management & Set fso = CreateObject ( "Scripting.FileSystemObject" )

what files can be deleted with sql 2012 express

Also copy the below script and save as E:\SQL_Backup\scripts\ deleteBAK.vbsĭim fso, folder, files, sFolder, sFolderTarget.You do need to create an empty file named E:\SQL_Backup\scripts \LOG.txt.The script also writes to a log file which Next, we will need to create a VBScript file which will be responsible for cleaning SELECT = 'BACKUP DATABASE TO DISK = + +'.BAK'' WITH INIT'ĮXEC FROM SYS.DATABASES WHERE > 0 AND AND NAME NOT IN ('TEMPDB') SELECT = NAME FROM SYS.DATABASES WHERE database_id = disk location here as required*/ SELECT FROM SYS.DATABASES WHERE > 0 AND NAME NOT IN ('TEMPDB') SET '0' + CAST(DATEPART(mi, GETDATE()) AS CHAR(2)) IF (SELECT LEN(DATEPART(mi, GETDATE())))=2 SET '0' + CAST(DATEPART(hh, GETDATE()) AS CHAR(2)) IF (SELECT LEN(DATEPART(hh, GETDATE())))=2 IF (SELECT LEN(CAST(DAY(GETDATE()) AS CHAR(2))))=2 SET '0' + CAST(MONTH(GETDATE()) AS CHAR(2)) IF (SELECT LEN(CAST(MONTH(GETDATE()) AS CHAR(2))))=2













What files can be deleted with sql 2012 express