0
votes

I want to export data from SQL server to CSV format but having issue with ntext dataype in some tables columns.

data is ntext column is html with html tags like br , li etc..

BRANDS SUBSECTION:BEAUTY, FRAGRANCE, GROOMING & HEALTH
Acticare
abc def PR
abc def T: 020-0000 1230 e: [email protected]

Added Dimension Dentistry
abc def PR
abc def T: 012-3456 7689

I have tried export from SQL server direcly exporting to csv format , tried SSIS package,even tried converting to varchar then export but when exported data is not showing correctly.

How do I export data to excel/csv having column data type ntext containing html tags ??

2

2 Answers

0
votes

When you are selecting the columns in the CSV file destination, try setting the Data Type for the source column to

text stream [DT_TEXT] or Unicode text stream [DT_NTEXT] (as the case maybe).

enter image description here

0
votes

I'm using SQL Server Export Wizard. In the choose destination be sure to use a Delimited Format with a double quote text qualifier.

Cast the column in the select statement CAST([Message] as NVARCHAR(255)) as Message (Message is defined as ntext)

Use a comma delimiter

...then map to DT_NTEXT in the export wizard