Link to home
Start Free TrialLog in
Avatar of RichNH
RichNH

asked on

SQL Server Import/Export Wizard data conversion component

Hi all, I have a table in a SQL Server 2008 Database which has a column called AltIndustries in nvarchar(max) format.  I ran into an error while trying to export this table to a tab-delimited text file and receive the error:

"Error 0xc020802e: Data Flow Task 1: The data type for "input column "AltIndustries" (301)" 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)"

A couple of things:  
The column is the output of a company function that defines its output as nvarchar(max) so that is working as expected.  

Apparently there's a data conversion component to the Import/Export wizard which I'm unaware of.  Does anyone know how I can install this component and use it?

I was able to get around the issue this time by CASTing the output of the function as CHAR(2000) but would like to gain greater understanding about the solution given in the error message.  I expect that I will be running into this again and the output then may be longer.  I'm trying to find a solution where I don't have to test the output length and modify code to insure the cast has enough space.

Comments?

Thanks, Rich
ASKER CERTIFIED SOLUTION
Avatar of Brendt Hess
Brendt Hess
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RichNH
RichNH

ASKER

The Unicode didn't work but the VARCHAR(MAX) did when I tested it.   Thank you.