Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003

    Cool Unanswered: Passing parameters from DOS batch to isql

    Does anyone has any idea is there anyway I can pass DOS batch (.bat) input parameters through isql (or something like) to exectute a SP that require those input parameters ?

  2. #2
    Join Date
    Jan 2005
    Yeah you can. Write a DOS batch file that reads the command line parameters and then echo the SQL you want to run, including the parameters into a temporary file, then call isql with that file. I've done it before, and it's not hard, just a bit of trial and error to get it going.

    rough (untested) example...

    batch file:
    echo EXEC SomeStoredProc %1, %2, %3 > in.sql
    echo go >> in.sql

    isql -i in.sql -o sql.out -Ddb -Sserver -Uuser -Ppassword

    You can then parse the sql.out too if you want to test results.

    Good luck, Carl.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts