I am trying to pull data from a table to a flat file and get a data conversion error with MS SQL - DT_TEXT

The error I get is
Error 0xc020802e: Data Flow Task 1: The data type for "input column "body1" (54)" is DT_NTEXT, which is not supported with ANSI files. Use DT_TEXT instead and convert the data to DT_NTEXT using the data conversion component.
 (SQL Server Import and Export Wizard)

How do I convert it to DT_TEXT?

this is the sql Statement I am using
select TOP 10 id, Rtrim(title)as title1, author, datecreated, Rtrim(body) as body1, image1,
REPLACE(RTRIM(SUBSTRING(Title, 1, 25)), ' ', '-') AS pagename
from ecsuheadlines
Jack SeamanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

F IgorDeveloperCommented:
Which column format is "ecsuheadlines.body",  TEXT / NTEXT ?
Try converting the field using CAST Function, also you can try to convert using another FORMAT like NVARCHAR if the "body" field
Also you can apply this function if you receive some warnings in another field (body1, image1)

select TOP 10 id, Rtrim(title)as title1, author, datecreated, CAST(Rtrim(body) AS TEXT ) as body1, image1,
REPLACE(RTRIM(SUBSTRING(Title, 1, 25)), ' ', '-') AS pagename
from ecsuheadlines

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.