Results 1 to 5 of 5

Thread: SQL scripts

  1. #1
    Join Date
    Jul 2008
    Posts
    16

    Unanswered: SQL scripts

    Is it possible to get output from scripts while they run? I have a script that generates a bunch of tables with PRINT and GO statements in between. I'd like to see the output from the PRINT statements while the script is running.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Run the script with SQLCMD.EXE and you'll be able to see the output as it is generated.

    The GUI tools cache the output, so you don't see anything until the tool is ready to show it to you which is often after the script completes (don't get me started on this design decision, you really don't want to know what I think of it)!

    -PatP

  3. #3
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    sorry, misunderstood the question. Is there a tee equivalent in cmd as exists in UNIX.

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    there is, but not from MS. lots of 3rd parties provide one:

    http://www.google.com/search?q=tee+for+windows

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    No, CMD.EXE executes the commands in a pipe sequentially instead of concurrently. That means that youi can achieve a similar effect to the Unix tee (echoing to both stderr and stdout) but the tee executable won't run until after the previous executable finishes, so the output won't be displayed while the first program is running.

    -PatP

Posting Permissions

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