I\'m running a query from SQL Server Management Studio 2005 that has an HTML file stored as a a string, e.g.:
SELECT html
FROM table
Thi
SQL Server Import and Export Data tool, FTW!
Start -> Programs -> Microsoft SQL Server -> Import and Export Data
Sample query:
select *
from (
select 'Row 1' as [row], 'Commas, commas everywhere,' as [commas], 'line 1
line 2
line 3' as [linebreaks]
union all
select 'Row 2' as [row], 'Nor any drop to drink,' as [commas], 'line 4
line 5
line 6' as [data]
) a
CSV output:
"row","commas","linebreaks"
"Row 1","Commas, commas everywhere,","line 1
line 2
line 3"
"Row 2","Nor any drop to drink,","line 4
line 5
line 6"
Disclaimer: You may have to get creative with double-quotes in the data. Good luck!