Search code examples
sqlsql-serverexportunion

I created a table using Union. Is there a way to export it into a csv file?


I am using MSSQL, and I generated a table by doing a union on 6 other tables.

I am trying to find a way to export the table into a CSV file that I just created. How can I do so?

Thank you!


Solution

  • Considering it is not used for automation purpose. You can execute your query, Then right click on result table in ssms, select option "save result as" and you'll get option to save as .csv file.