I have a query that I am running in SQL Server Management Studio (connecting to a SQL Server 2005 database). I want to export the data in CSV format. Not wannabe CSV format,
I know of no way to do this with SSMS alone. I know TOAD (http://www.toadworld.com/) has a CSV option. Not sure if it is an escaped format. If SSIS is an option, you can convert to a format that escapes strings (true CSV), but that is not in SSMS.
If you have to write a C# program, I would consider querying the table and then running the query, as the metadata will clue which need the escape.