• Dunno if relevant, but just in case ...

    We have to "export" a CSV list of various mail-lists (i.e. filtered on various categories) to a Bulk Email service each night.

    We have a small executable (probably written in VBScript! its been around for many years) which makes a query to the DB to a "Config Table" to get details of all the reports to run (in our case they are all Stored Procedure names, but could be VIEWs that will just take a SELECT * - obviously very easy to add a new one), and the details of the "target source" (again, in our case that's the details of the EMail System Owner and Target Name of the list) and it runs the query, bundles up all the rows / columns as CSV, and then squirts the output up to the bulk email service API.

    The actual code to do the CSV part was trivial, but we did need to take care of properly quoting columns that had embedded commas, and then double-quoting any of those that had quotes, as per CSV spec, and to catch anything with embedded newlines etc. which is not something that BCP is able to do AFAIK.