How to bulk copy sql (export) tables to a csv or tsv files in .Net?

c# sql sqlbulkcopy

Question

Are there any .Net libraries that provide a way of exporting sql database data to plain text files (i.e. csv\tsv)? SqlBulkCopy only applies to the import part of the solution and I prefer not to be calling any Process.Start calls to open up command prompts to call bcp.exe.

Accepted Answer

Ended up using bcp Process calls unfortunately


Popular Answer

Check out FileHelpers - it allows you to easily load or save data from CSV or other text file formats. Excellent code base, freeware, full C# source available - can't recommend it enough!




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why