How To Perform Scheduled Backups For SQL Server 2005 Express How To Perform backup pianificati per SQL Server 2005 Express
SQL Server 2005 Express edition is a free, lightweight and embeddable version of SQL Server 2005 which includes SQL Server Management Studio Express for users to easily manage that databases. SQL Server 2005 Express Edition è una versione libera, leggera e incorporabile di SQL Server 2005 che include SQL Server Management Studio Express per gli utenti di gestire facilmente che i database. Although SQL Server 2005 Express edition supports backup and restore database but it does not supports scheduling backups. Anche se SQL Server 2005 Express Edition supporta il backup e il ripristino del database, ma non supporta la pianificazione dei backup.

Below are the simple steps to perform in order to enable scheduling backups for SQL Server 2005 Express: Di seguito sono riportati i semplici passi per eseguire al fine di consentire la pianificazione di backup per SQL Server 2005 Express:
- Create a store procedure that allows generate the dynamic backup file name, with types of backup to run such as full, differential or transaction log backups and location of the Backup files. Creare una procedura di negozio che permette di generare il nome del file di backup dinamico, con tipi di backup per eseguire come completo, differenziale o di backup del log delle transazioni e il percorso del file di backup.
USE [master] USE [master] CREATE PROCEDURE [dbo].[sp_BackupDatabase] CREATE PROCEDURE [dbo]. [Sp_BackupDatabase] @databaseName sysname, @backupType CHAR(1) @ databaseName sysname, @ CHAR TipoBackup (1) AS AS BEGIN BEGIN SET NOCOUNT ON; SET NOCOUNT ON; DECLARE @sqlCommand NVARCHAR(1000) DECLARE @ NVARCHAR SqlCommand (1000) DECLARE @dateTime NVARCHAR(20) DECLARE @ dateTime NVARCHAR (20) SELECT @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),111),'/','') + @ Datetime = SELECT REPLACE (CONVERT (VARCHAR, GETDATE (), 111 ),'/','') + REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','') REPLACE (CONVERT (VARCHAR, GETDATE (), 108 ),':','') IF @backupType = 'F' IF @ TipoBackup = 'F' SET @sqlCommand = 'BACKUP DATABASE ' + @databaseName + SET @ SqlCommand = 'BACKUP DATABASE' + @ databaseName + ' TO DISK = ''C:\Backup\' + @databaseName + '_Full_' + @dateTime + '.BAK''' 'TO DISK =''C: \ Backup \' + @ databaseName + '_Full_' + @ dateTime + '. BAK''' IF @backupType = 'D' IF @ TipoBackup = 'D' SET @sqlCommand = 'BACKUP DATABASE ' + @databaseName + SET @ SqlCommand = 'BACKUP DATABASE' + @ databaseName + ' TO DISK = ''C:\Backup\' + @databaseName + '_Diff_' + @dateTime + '.BAK'' WITH DIFFERENTIAL' 'TO DISK =''C: \ Backup \' + @ databaseName + '_Diff_' + @ dateTime + '. BAK''con differenziale' IF @backupType = 'L' IF @ TipoBackup = 'L' SET @sqlCommand = 'BACKUP LOG ' + @databaseName + SET @ SqlCommand = 'BACKUP LOG' + @ databaseName + ' TO DISK = ''C:\Backup\' + @databaseName + '_Log_' + @dateTime + '.TRN''' 'TO DISK =''C: \ Backup \' + @ databaseName + '_Log_' + @ dateTime + '. TRN''' EXECUTE sp_executesql @sqlCommand Sp_executesql EXECUTE @ SqlCommand END END
- Create a SQL script to run the backup. Creare uno script SQL per eseguire il backup. In this example, we will backup database master and saved the below SQL script as dbbackup.sql and save in “c:\Backup” folder. In questo esempio, si master del database di backup e ho salvato il seguente script SQL come dbbackup.sql e salvare in "C: \ Backup" cartella.
sp_BackupDatabase 'master', 'F'
GO
QUIT - Create a scheduled task in Windows which can be found in Control Panel or Accessories -> System Tools -> Scheduled Tasks or Task Scheduler. Creare un'operazione pianificata in Windows che può essere trovato nel Pannello di controllo o Accessori -> Utilità di sistema -> Operazioni pianificate o Utilità di pianificazione.

- Click on Add Scheduled Task or Create Task. Fare clic su Aggiungi operazione pianificata o Crea attività. Scheduling wizard will be displayed. Pianificazione guidata verrà visualizzato. Click Next, then click the Browse button to find SQLCMD.EXE from “C:\Program Files\Microsoft SQL Server\90\Tools\Binn”. Fare clic su Avanti, quindi fare clic sul pulsante Sfoglia per trovare SQLCMD.exe da "C: \ Program Files \ Microsoft SQL Server \ 90 \ Tools \ Binn".

In Task Scheduler, define the above in Action tab. In Utilità di pianificazione, di definire la scheda di cui sopra in azione.
- Specify when to perform the task as well as the user name and password to run the operation. Specificare quando eseguire l'operazione, nonché il nome utente e password per eseguire l'operazione. Once finished, give the scheduled task a name and save the task. Una volta finito, l'operazione pianificata dare un nome e salvare l'attività.
- Click on the “Open advanced properties” to edit the command. Fare clic su "Apri proprietà avanzate" per modificare il comando.

Type the following command in Run: Digitare il seguente comando in Esegui:
sqlcmd -S serverName -E -i C:\Backup\sqlBackup.sql sqlcmd-S nomeserver-E-i C: \ Backup \ sqlBackup.sql
The meaning of the command: Il significato del comando:
- sqlcmd sqlcmd
- -S (this specifies the server\instance name for SQL Server) -S (questa specifica il server \ nome di istanza di SQL Server)
- serverName (this is the server\instance name for SQL Server) serverName (questo è il server \ nome di istanza di SQL Server)
- -E (this allows you to make a trusted connection) -E (questo ti permette di fare una connessione trusted)
- -i (this specifies the input command file) -i (questo comando specifica il file di input)
If you want to test the task which has been created then you can go back to the Scheduled Tasks or Task Scheduler, right click on the task and select “Run”. Se si desidera verificare il compito che è stato creato allora si può tornare alla Operazioni pianificate oppure il Task Scheduler, fate clic destro sul compito e selezionare "Esegui".
IMPORTANT : The page is machine translated and provided "as is" without warranty. IMPORTANTE: La pagina è tradotta e fornite "come sono" senza garanzia. Machine translation may be difficult to understand. La traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento alla original English article L'articolo originale inglese whenever possible. quando possibile.
Related Articles Articoli correlati
- Error Has Occurred While Establishing A Connection To SQL Server 2005 Which Does Not Allow Local and Remote Connections Errore si è verificato mentre stabilisce una connessione a SQL Server 2005 che non consente locali e connessioni remote
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Disinstallare e rimuovere più istanze di database Microsoft SQL Server 2005
- How to Set Compatibility Level for SQL Server 2008 or 2005 Database Come impostare Livello di compatibilità per SQL Server 2008 o 2005 Database
- Microsoft Virtual Server 2005 R2 SP1 (Enterprise Edition) Direct Download Links Microsoft Virtual Server 2005 R2 SP1 (Enterprise Edition) Direct Download Links
- Internet Explorer (IE) Hang When Opening Virtual Server 2005 Web Administration Site Internet Explorer (IE) Hang durante l'apertura di Virtual Server 2005 Web Site Administration
- Microsoft Virtual Server 2005 R2 Download Available for Free Microsoft Virtual Server 2005 R2 disponibile per il download gratuito
- Microsoft DreamSpack Offers Free Download and License of Visual Studio 2008, Server 2003, SQL Server 2005 and More Microsoft DreamSpack Offerte Download gratuito e licenza di Visual Studio 2008, Server 2003, SQL Server 2005 and More
- Restore Windows XP and 2003 .bkf Backups in Windows Vista and Longhorn Server with NT Backup Restore Utility Ripristino di Windows XP e 2003. Bkf backup in Windows Vista e Longhorn Server con NT Backup Restore Utility
- Optimize SQL Server 2000, 2005 or 2008 in Large RAM System by Locking Pages in Memory and AWE Ottimizzare SQL Server 2000, 2005 o 2008 in Large RAM System by Locking Pages in Memory and AWE
- Download Paragon Drive Backup 9.0 Free Edition (Express) Download Paragon Drive Backup 9.0 Free Edition (Express)










































September 10th, 2009 02:32 10 settembre 2009 02:32
Excellent article, I´ve just modify it a little and now I can make backup of all my DB´s in a single scheluded task. Ottimo articolo, ho solo modificare un po 'e ora posso fare il backup di tutti i miei PB in una singola attività scheluded.
Thank you! Grazie!
September 10th, 2009 02:31 10 settembre 2009 02:31
Excelent article, I´ve just modify it a little and now I can make backup of all my DB in a single scheluded task. Ottimo articolo, ho solo modificare un po 'e ora posso fare il backup di tutti i miei PB in una singola attività scheluded.
Thank you! Grazie!
August 26th, 2009 20:58 26 agosto 2009 20:58
shah_pradeep@yahoo.in shah_pradeep@yahoo.in