Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Posts
    7

    Unanswered: Calling a script from inside another scripts

    I need to call a script from inside another script. How do I do this? I don't know if it matters but I will be doing all of this from inside of isql.
    Thanks for any help.

  2. #2
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    Use the EXECUTE command

    Example:
    Code:
    UPDATE tbl
    SET col1 = col1 * 0.787
    WHERE col2 = 'x'
    
    IF @@ERROR <> 0
       EXEC("isql -E -SMyServer -Q -iD:\MYScript\Error.sql")

  3. #3
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    Where is my mind, you need to use master..xp_cmdshell

    Code:
    UPDATE tbl
    SET col1 = col1 * 0.787
    WHERE col2 = 'x'
    
    IF @@ERROR <> 0
       master..xp_cmdshell "isql -E -SMyServer -iD:\MYScript\Error.sql"

Posting Permissions

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