Redirect Message Output

  • Is there any way to redirect all of the output information that normally displays in Query Analyzers messages window?

    I have several queries and stored procedures that being able to write this information to a file would be of HUGE benefit.

    Thanks

     

    Tom

  • In Query Analyzer, click tools/options/results

    You have option to save result to file.

  • I probably did not explain myself very well, Sorry.

    I just want to get the same kind of information that normally shows up as a message in Query analyzer but I will not be running Query Analyzer. I want to schedule a job that runs in the middle of the night without assistance and does not use query analyzer.

     

    Thanks for your reply

     

    Tom

     

     

  • If you're talking about scheduling the job...

    If you use SQL Agent Job Scheduler, when you add a step to the job, on the advanced tab there is an option to specify the log file. This should do the trick for you.

    Regards,

     

    Greg M Lucas
    "Your mind is like a parachute, it has to be open to work" - Frank Zappa

  • You can also use the command-line version, OSQL, and specify an output file using the "-o" option.  Note that you may need the "-w" option to specify a line-width greater than 255.  Look in BOL under "osql utility."

     

  • i can´t imagine how can i do that on 6.5 version...  

  • Look at isql for version 6.5.

  • I can do it running a batch with this string:

    isql -S server -U sa -P password -d userdatabase -Q "exec SP" -o salida.txt

     

    Late answer, but who knows...maybe still could help

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply