Per permettere il backup automatico dei databases, creare un file.bat con dentro:
osql -U kw96Admin -P 96KwXC -i "E:\BackupDB\BackupSQL.sql"
Nel file BackupSQL.sql mettere:
DECLARE @BackupName VARCHAR(255) DECLARE @BackupFileName VARCHAR(255) DECLARE @DBName VARCHAR(255) DECLARE @Percorso VARCHAR(255) SET @Percorso = 'F:\BackUPdb\' ------------------------------------------------------------------------ SET @DBName = 'nsittANA' SET @BackupFileName = @Percorso + @DBName + '_' + datename(weekday, getdate()) + '.bak' BACKUP DATABASE @DBName TO DISK = @BackupFileName WITH NOFORMAT, INIT, NAME = @BackupFileName, SKIP, REWIND, NOUNLOAD ------------------------------------------------------------------------ SET @DBName = 'nsittMSK' SET @BackupFileName = @Percorso + @DBName + '_' + datename(weekday, getdate()) + '.bak' BACKUP DATABASE @DBName TO DISK = @BackupFileName WITH NOFORMAT, INIT, NAME = @BackupFileName, SKIP, REWIND, NOUNLOAD
Category:
SQL