Save output of multiple queries into file?
Try below:-
- Open SQL Server Management Studio
- Go to Tools > Options > Query Results > SQL Server > Results To Text
- Then on right hand side, change output format to comma delimited.
- Run your query and then right click on results and click save results to file.
- Once done rename the file from .rpt to .csv
Go to the Query menu > "Results to"... and then pick "to file" or whichever you want. Change rpt extention to csv.
Be sure to re-run your queries.