Results 1 to 3 of 3

Thread: osql in batch file

Hybrid View

  1. #1
    Join Date
    Sep 2002
    Posts
    53

    osql in batch file

    Hi,

    I am trying to run the following command. I am not getting the results that I expect.

    For /f %%i in (\\testserver\dts_out\File_Ack_In.txt) Do osql -U %login% -P %pswd% -S %Server% -d %dbname% -Q "exec sp_process_inc_files %i,%filetype,%filesubtype"


    I echo the values of the variables after I execute the command. When echo'd they return the correct values. And if i use these values to exec the proc from query analyzer, i get the results i expect. But running this in a dos batch file does not seem to work.

    Any suggestions?






    Thanks,

    Jim

  2. #2
    Join Date
    Mar 2003
    Location
    NJ
    Posts
    201
    Why u r using percentage symbol? Shall u replace it with doble quote symble and try again

    What does this real do?

    -Q "exec sp_process_inc_files %i,%filetype,%filesubtype"

  3. #3
    Join Date
    Sep 2002
    Posts
    53
    claire,

    thanks for your reply - i figured out my question - to execute a proc via osql you need to specify the names of the input parameters (i.e. @var1 = %filename)

    thanks

    jim

Posting Permissions

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