----------- Stored Procedure > backup_handle ----------- USE [your_database] GO /****** Object: StoredProcedure [dbo].[backup_handle] Script Date: 05/05/2009 14:03:31 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*********************************************************************** DEVELOPED BY : Dimitris Siskopoulos CREATED : 05.05.2009 DESCRIPTION : Handles database backup VERSION : 1.0.0 CHANGES : ************************************************************************/ ALTER PROCEDURE [dbo].[backup_handle] @databaseName varchar(100), @backupDirectory varchar(100) AS --set @databaseName = 'YourDatabaseName' --set @backupDirectory = 'd:\mywebsites\' ----------------------------------------------------------------- -- Backup database to file ----------------------------------------------------------------- DECLARE @backupFileName varchar(100), @databaseDataFilename varchar(100), @databaseLogFilename varchar(100), @databaseDataFile varchar(100), @databaseLogFile varchar(100), @execSql varchar(1000) -- Set the name of the database to backup --set @databaseName = 'myDatabase' -- Set the path fo the backup directory on the sql server pc --set @backupDirectory = 'aboslute_path_to_backup_directory' -- such as 'c:\temp\' -- Create the backup file name based on the backup directory, the database name and today's date set @backupFileName = @backupDirectory + @databaseName + '-' + replace(convert(varchar, getdate(), 110), '-', '.') + '.bak' set @execSql = ' backup database [' + @databaseName + '] to disk = ''' + @backupFileName + ''' with noformat, noinit, name = ''' + @databaseName + ' backup'', norewind, nounload, skip' exec(@execSql) -- EOF -- ----------- COLDFUSION 8 CFML -----------

done!

Click to download #BackupName#.zip

Click here to delete the backup files after your download!

File #ExpandPath('./#BackupName#')# deleted succesfully!

File #ExpandPath('./#BackupName#')# not found!

File #ExpandPath('./#BackupName#.zip')# deleted succesfully!

File #ExpandPath('./#BackupName#.zip')# not found!

Click here to return to main page of your site #Request.ROOT#