Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004

    Unanswered: Any way to pass command line variables to osql

    I want to pass a command line values into an osql run stored procedure.
    The commandline values should be are the values to put into the insert stored procedure that writes them to a table.

    Is it possible to do this.

  2. #2
    Join Date
    Sep 2004
    if ur parameter is positioned 2nd then add this code in your command file.

    <varname> is some variable name that you want to use to trap the parameter. lets say empid for instance

    SET empid=%2

    after this, the place where u wud be calling ur stored procedure use this syntax.

    osql -S servername -l 60 -n -E -d dbname
    -Q"EXEC sp123 @Var1 = '%empid%'"
    Last edited by armurthy; 09-13-04 at 04:36.

Posting Permissions

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