Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2011
    Posts
    10

    Unanswered: SQL 2000 run .exe

    SQL 2000 ; Windows 2000.

    I have Stored procedure that runs every day called MASTER_SP.
    Master SP runs another 10 stored procedures sequentially

    10 stored procedures
    Procedure 1
    Procedure 2
    Procedure 3..
    Procedure10

    When these stored procedures complete successfully, they record the status in a Table_Status with value 1 if the stored procedure is successful or 0 if it fails.
    Table_Status Fields are; DATE_RUN , PROCEDURE_1 , PROCEDURE_2, PROCEDURE_3, PROCEDURE_4

    REQUIRED :What I want is that when the MASTER_SP is finished and if all the values in Table_Status are 1 and a Date in another Table called Table 2 reads tomorrows date than it should start a .exe program on another Server with a Specific User name e.g USER1 and password.

  2. #2
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    831
    Might want to consider using cmdshell for this purpose. The sql check will be a block where xp_cmdshell executes the .exe

    xp_cmdshell

    Quote Originally Posted by jaqaz View Post
    SQL 2000 ; Windows 2000.

    I have Stored procedure that runs every day called MASTER_SP.
    Master SP runs another 10 stored procedures sequentially

    10 stored procedures
    Procedure 1
    Procedure 2
    Procedure 3…..
    Procedure10

    When these stored procedures complete successfully, they record the status in a Table_Status with value 1 if the stored procedure is successful or 0 if it fails.
    Table_Status Fields are; DATE_RUN , PROCEDURE_1 , PROCEDURE_2, PROCEDURE_3, PROCEDURE_4

    REQUIRED :What I want is that when the MASTER_SP is finished and if all the values in Table_Status are 1 and a Date in another Table called Table 2 reads tomorrows date than it should start a .exe program on another Server with a Specific User name e.g USER1 and password.
    Last edited by corncrowe; 04-27-12 at 10:15.

  3. #3
    Join Date
    Aug 2011
    Posts
    10

    How

    I need a script.

  4. #4
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    831
    Quote Originally Posted by jaqaz View Post
    I need a script.
    Well you'll never learn if everything is given to you. Try creating the script on your own and come back here for help if it doesn't work.

    Pseudo code:
    declare count local variable
    get count of successful executions
    if count = 10 then
    begin
    declare results local variable
    execute cmdshell with results
    check results
    if ok then goto exit else goto exit_error
    end
    else
    begin
    goto exit_error
    end

Posting Permissions

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