kmetski Posted May 26, 2009 Share Posted May 26, 2009 (edited) The program can backup and restore MSSQL databases over the local area network. Supports Automatic Backup once in a day. The Backup name is set to database name + date at the moment of backup + time at the moment of backup. You need to have a dir in D:\SQL_BACKUP. Tested on Microsoft SQL SERVER 2005 EXPRESS. In the rar are all files. In VER. 1.9.1 NEW GUI thanks to Franck. Added user defined DIR. Added Automatic backup password encryption. Added Auto archiving backup file whit WINRAR. Added Auto extract backup when restoring database. Added GUI HIDE ON START. Added Automatic backup for multiple databases. The names must be delimited whit ";" except the last name. HOT keys CTRL+F11 = hide ; CTRL+F10 = show; If somebody finds an errors pls tell me.AUTO_BACKUP_SQL_Database_ENG.au3AUTO_SQL_BACKUP_ENG.rarAUTO_SQL_BACKUP_ENG_V1.9.1.rar Edited May 29, 2009 by kmetski Link to comment Share on other sites More sharing options...
FranckGr Posted May 29, 2009 Share Posted May 29, 2009 (edited) The program can backup and restore MSSQL databases over the local area network.Supports Automatic Backup once in a day.The Backup name is set to database name + date at the moment of backup + time at the moment of backup.You need to have a dir in D:\SQL_BACKUP.Tested on Microsoft SQL SERVER 2005 EXPRESS.In the rar are all files.In VER. 1.9.1NEW GUI thanks to Franck.Added user defined DIR.Added Automatic backup password encryption.Added Auto archiving backup file whit WINRAR.Added Auto extract backup when restoring database.Added GUI HIDE ON START.Added Automatic backup for multiple databases. The names must be delimited whit ";" except the last name.HOT keys CTRL+F11 = hide ; CTRL+F10 = show;If somebody finds an errors pls tell me.Thanks for adding Added Automatic backup for multiple databases.... That will helpI hhad to move these 2 lines to the TOPglobal $inpdbrglobal $inpdbr1As Autoit 3.3 tells he prefers Global declarations on top of the script ... Edited May 29, 2009 by FranckGr Link to comment Share on other sites More sharing options...
newhere2 Posted June 18, 2019 Share Posted June 18, 2019 (edited) Can anyone update that script, so that it works please? I still get an error at Line 47: Error: Subscript used on non-accessible variable. Edited June 18, 2019 by newhere2 Link to comment Share on other sites More sharing options...
t0nZ Posted June 18, 2019 Share Posted June 18, 2019 You touched a very old one. Btw, you need the file setting.cfg, it is read to acquire the values of the array (sql parameters) and you have to figure out the (easy) structure. Not sure it works with SQL server 2008+, it was for versions 2005. If you need an example I have recent scripts to do something similar. Link to comment Share on other sites More sharing options...
t0nZ Posted July 9, 2019 Share Posted July 9, 2019 Hi to all and Hi @alc sorry for the late reply, I'll post to you two snippets. for backup RunWait(@ComSpec & " /c sqlcmd -U yourUserName -P yourPassword -S database\instance -Q ""backup database DATABASENAME to disk = '" & $PATH & "\backupName.dat'""") for restore RunWait(@ComSpec & ' /c sqlcmd -U yourUsername -P yourPassword -S database\instance -Q "RESTORE DATABASE [' & $DBname & '] FROM DISK= ''' & $DBFILEname & ''' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10, MOVE ''' & $DBname & '_data'' TO ''' & $path2db & 'DATA\' & $DBname & '.MDF'', MOVE ''' & $DBname & '_LOG'' TO ''' & $path2db & 'DATA\' & $DBname & '_LOG.LDF''" -o ' & $path2db & 'backup\log_restore.txt') Please read, understand, adapt to your needs. In this way you don't need #includes, it works with MSSQL 2008R2 and following. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now