Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009

    Post Unanswered: SQL script and Task Scheduler (SQL 2005 express)

    Hello everyone,

    I'm trying to run a script through task scheduler on a client's server (w/ Windows Server 2003 for Small Business Server SP1).

    If I create the task (w/ password) without adding parameters the task runs fine - except that it just opens the Management Studio Express and asks for a connect.

    If I put these parameters sqlcmd -S .\lp72005 -i "c:\programs...\backup.sql" (in order for it run the script, instead of just opening management studio) the task fails.


    - Executing the script manually (double click and management studio) works fine.

    - The password I'm using is valid - if the task runs without the parameters, it means the password is valid.

    - Right-clicking on the task and executing it doesn't work.

    - The "Status" collumn in the Scheduled Tasks folder says (translated) "Could not initiate"

    - The instance name in the parameters is correct.

    - The path to the script in the parameters is correct.

    - The same parameters are working on another computer (ours) except it has Windows XP

    If anyone has any ideas, I would be thankful.

    Thanks in advance,

    Joo Santos

  2. #2
    Join Date
    Jun 2004
    Long Island
    That servername looks a bit funky.

  3. #3
    Join Date
    Sep 2009
    You mean the "-S .\lp72005", right?

    Well I found it odd too, and I tried to put servername\lp72005 but it still didn't work (forgot to mention it earlier). And besides that, these parameters do work on other computers like I said.

    Thanks anyway for your input.

    Edit: Solved: I put the parameters in a batch file, scheduled it (the batch file) and it worked.

    João Santos
    Last edited by blinx; 10-01-09 at 04:11.

Posting Permissions

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