In Object Explorer, right-click the target table to select data for, and then click "Select Top 1000 Rows".
Then right-click on the top left of The "Results", and then click "Save Results As...".
The question of the case of saving the file in this way.
Saved files contain headers. I want to save without headers.
Strangely enough, if i copy the auto-generated SQL at this time and then click "New Query" and run the exact same SQL pasted into a new tab, there is no header if i save the file in the same operation.
The options are set as follows:
- Tools > Options > Query Results > SQL Server > Results To Grid
- "Include column headers when copying or saving the results" is OFF.
If this setting is turned ON, it will always be saved files contain header, even in the case of query results selected by "New Query".
The way I want to know is to save the query results without headers in any case.
Currently, I am correcting the saved file myself, but it is laborious because there are many opportunities to do it.
Also, if you can't, I want to explain the cause to my stakeholders.
I'd appreciate it if someone could answer my questions.
==================================================
The state of my environment about the settings I was taught in reply from Viorel-1.
About "Include column headers when copying or living the results" ON/OFF.
1) Tools > Options > Query Results > SQL Server > Results To Grid
Always OFF.
2) Query > Query Options... > Results > Grid
When executed from "New Query", it is OFF.
When executed from "Select Top 1000 Rows", it is ON.
I always want this to be OFF, but no matter how many times I set it to OFF, it is always ON when I run "Select Top 1000 Rows".
I'd appreciate it if someone could answer my questions.