Jump to content

Recommended Posts

Posted

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"
 

Posted

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'"

 

  • 3 weeks later...
Posted

Floops,

 

Thanks for the reply. I was getting errors at first, but I added a ) at the end, and now I get no errors, but the backup doesn't work.

  • 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
×
×
  • Create New...