Jump to content

SQL DB Backup


Recommended Posts

Hello All,

I'm totally new to AutoIT, and I've tried to make this function work somehow, with AutoIT. This is what I've used in a dos batch file, but want to create an AutoIT script. Any help would be appreciated.

set BACKUPFILENAME1=c:\ck\dbbackups\ServerTT.bak

sqlcmd -S localhost -U sa -P ?????? -d tora -Q "BACKUP DATABASE test TO DISK = N'%BACKUPFILENAME1%' WITH INIT , NOUNLOAD , NAME = 'test_backup', NOSKIP , STATS = 10, NOFORMAT"
 

Link to comment
Share on other sites

This should work

 

$BACKUPFILENAME1 = "c:\ck\dbbackups\ServerTT.bak"

Run(@ComSpec & ' /c ' & "sqlcmd -S localhost -U sa -P ?????? -d tora -Q 'BACKUP DATABASE test TO DISK = N'" & $BACKUPFILENAME1 & "' WITH INIT , NOUNLOAD , NAME = 'test_backup', NOSKIP , STATS = 10, NOFORMAT'"

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...