If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > SQL scripts

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-08, 12:37
Andre Smit Andre Smit is offline
Registered User
 
Join Date: Jul 2008
Posts: 16
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.
Reply With Quote
  #2 (permalink)  
Old 12-03-08, 13:12
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 11,056
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
Reply With Quote
  #3 (permalink)  
Old 12-05-08, 10:01
PMASchmed PMASchmed is offline
Registered User
 
Join Date: Jun 2004
Location: Long Island
Posts: 696
sorry, misunderstood the question. Is there a tee equivalent in cmd as exists in UNIX.
Reply With Quote
  #4 (permalink)  
Old 12-05-08, 10:19
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,271
there is, but not from MS. lots of 3rd parties provide one:

http://www.google.com/search?q=tee+for+windows
__________________
elsasoft.org
Reply With Quote
  #5 (permalink)  
Old 12-05-08, 11:00
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 11,056
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On