I want to generate a .CSV file based on data in a datatable. I know this question has been asked before, but I can't find any examples of how to specify what the separator should be.
For example if I have a table and a query like this, this is what I want the output to be:
MyTable:
Id - Int Key
NickName- NvarChar
REALName - NvarChar
Number - NvarChar
Updated - bit
Query:
SELECT *
FROM MyTable
WHERE Updated = 1
Output:
I want my output to use | as the field separator. So the output in the CSV file will look something like this:
Id|NickName|REALName|Number|Updated
1|NickNameHere|RealNameHere|0798548558|1
2|NickNameHere2|RealNameHere2|079948558|1
and so on.