Hi @Madsen, Ken ,
Just look at the right side of the Results pane. You will find there options to save as follows:
- .csv (supposedly what you need)
- .xslx
- .json
- .xml
Please see below.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to run multiple statements and get the results in text format, but I can't figure out how to save the results in a text file
Hi @Madsen, Ken ,
Just look at the right side of the Results pane. You will find there options to save as follows:
Please see below.
Hi MadsenKen-8691,
Welcome to Microsoft Q&A.
Unfortunately, Azure Data studio does not currently support saving results as text.
You can save result to CSV as YitzhakKhabinsky mentioned, or as an alternative, you can use SSMS to save result to text.
Please refer to this doc and this article which might be help.
In addition, you can submit it to the Microsoft feedback at this link https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0
Your feedback is valuable for Microsoft to improve the level of products and service. Appreciate for your understanding.
Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi MadsenKen-8691,
Thanks for your reply.
You can download SSMS from here, and use SSMS to save result to text file.
Or we can use command-line Bcp utility to export data to text file.
For example:
bcp "SELECT * FROM dbo.table" queryout C:\temp\test.txt -S servername-d dbname -c -t, -T
Please also check Import and export bulk data using bcp and 8 Ways to Export SQL Results To a Text File which might be help.
Best Regards,
Amelia
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
I was looking at how to do the same thing since my class requires us to put the answers with our queries by copying and pasting the text output. (I'm on a Mac using Microsoft SQL Server, with Azure Data Studio) The best solution I have found that doesn't require many steps is to save the results as Markdown, and it's essentially the same as copying text results.