Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    23

    Unanswered: trying to use osql in SQL Server 2000

    I want to run a stored procedure, from a .bat file.
    Here is line 1 of the .bat file
    osql -S SISPROD -d gSchool -E -Q "xSP_Attendance_Post_All_1Day '0708'"

    When I run it as a Schedule Task, get
    Run-time error '-2147217904...' Procedure 'xSP_Attendance_Post_All_1Day' expects parameter '@sy' which was not supplied.

    The '0708' is the @sy parameter.
    What is wrong with the command?

    The weirder thing is that when I get a command prompt, any osql command gives me this:
    'osql' is not recognized as an internal or external command,...'

    Unless I run the .bat file -- then I get the same error as the 1st above.

    SQL Server is not installed on this server. How does the Scheduled task run osql (although with the 1sterror above)? The task is running as "me", Active Directory user, same as I am logged on to server but cannot run osql at all.
    TIA

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    you need the client tools installed for osql.

    try this...

    osql -S SISPROD -d gSchool -E -Q "xSP_Attendance_Post_All_1Day '''0708'''"
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    May 2003
    Posts
    23
    Thanks!
    You're right -- I would have to install client tools.
    The sql server error message I am seeing is coming from another place in the program being run by the .bat file.
    Last edited by ts555; 11-05-07 at 13:24.

Posting Permissions

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