Running SQL scripts and getting the full result in a text file etc RRS feed

  • Question

  • Hi,

    I would like to run 3 SQL scripts via powershell, and these scripts output a lot of text/report. I would like the output to be intact and be in a  text file not truncated etc, what is the best way to achieve this please ?

    Thanks in advance.

    Thursday, August 3, 2017 4:52 PM

All replies

  • You can use Out-File or Export-Csv to save the output.

    help Out-File -full

    help Export-Csv -full


    • Proposed as answer by epavvol Monday, August 7, 2017 8:39 PM
    Thursday, August 3, 2017 5:09 PM
  • Hi,
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, September 6, 2017 7:24 AM