I am working a lot with excel and CSVs for my SSIS packages these days. so I need to some input files as CSV files from SQL Server. Here is what I did in SQL Server Management Studio to get CSV files with Headers
Now open your query window and write you query and execute. On the results window right click and select "save results as" and then save to CSV file which I can open in excel.
- Go to Tools in SQL Server Management Studio and click options.
- Now click on Query Results and select SQL Server.
- Now go to Results to Grid.
- Select “Include column headers when copying or saving the results. (shown in below image)
- Click OK
- Restart SQL Server Management Studio and you are good to go now.
No comments:
Post a Comment