0

I have already researched on this site as well as on google extensively for this. I have created a number of batch files that perform certain automated transactions(backups etc) on our production database.

i want to further simplify my end of day processes by taking the dumps using a script that accepts input of some parameters. the script is able to login the isql prompt but unable to do the execution of the commands.

Problem is that the isql prompt returns but the 3 commands are not executing

  @ECHO ***Started***
  @ECHO Enter MonthDay(MMDD)

   SET /p md=
  @ECHO  %md%

  mkdir \\10.20.1.17\arch\212%md%_banking
   set run=isql -Uuser -SORBITS -Ppass 
   %run%
   @echo dump database banking to '/media/newArch/212%md%_banking/212%md%EOD_banking.dmp' with compression=5  
   @echo dump database master to '/media/newArch/212%md%_banking/212%md%EOD_master.dmp'
   @echo go
    pause

I have been unsuccessful at putting these in a separate script file because the script itself uses a passed parameter.

Please give me hints and links to
Thanks

Danny Beckett
  • 20,529
  • 24
  • 107
  • 134
prubyholl
  • 11
  • 1
  • 4

1 Answers1

0

I don't see how your commands get to isql.

Why don't you echo them into a file and then pass that to isql with "-i" ?

Windows batch language is very painful. If you're doing any amount of scripting you'll find it better to learn a bit of perl, bash or python.

Abe Crabtree
  • 524
  • 3
  • 9