I have a SQL query which returns only one column with object Ids. After executing the query in management studio, When I right click on the result grid and select "Save Results As..." to CSV, output gets properly stored in CSV file.
But when I tried reading the same output file from a java program, then I observed few special characters have got added at the beginning of the file (before first record).
So I typed the file in command prompt and I could see the special characters. The characters are not visible in any of the editor (Notepad/Notepad++/EditPlus). That means the special characters are getting added to the output file while exporting the results.
If I select all the records and copy-paste them in Ms-Excel then there is no issue of special characters.
Has anybody faced this issue? Any way to avoid it?