Jump to content

Recommended Posts

Posted (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.au3

AUTO_SQL_BACKUP_ENG.rar

AUTO_SQL_BACKUP_ENG_V1.9.1.rar

Edited by kmetski
Posted (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.

Thanks for adding Added Automatic backup for multiple databases.... That will help

I hhad to move these 2 lines to the TOP

global $inpdbr

global $inpdbr1

As Autoit 3.3 tells he prefers Global declarations on top of the script ...

Edited by FranckGr
  • 10 years later...
Posted (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 by newhere2
Posted

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.

  • 3 weeks later...
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...