Converting DT_TEXT into DT_NTEXT

If you trying to extract data from a flat file and got the following error:

Error 1 Validation error. Extract Interface Message ID Data: Extract Interface Message ID Data [1]: The data type for “output column “InterfaceMessageBody” (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.

It looks like one or more column datatype in the FlatFile Source has become DT_NTEXT instead of DT_STR.
You can try the following steps to rectify the error:

  1. Right Click the Flat File Source Component that is generating this error.
  2. Choose “Show Advanced Editor” from the context menu and then the “input and output properties” tab on the dialog box that appears.
  3. Click on the + sign beside “Flat File Source Output” node in the treeview on the left side of the dialog box.
  4. Click on the + sign beside “output columns” node in the treeview just below “Flat File Source Output” node. You would see all the columns available in the text file.
  5. Select each column one after another and check their dataType property on the Right side of the Dialog box.
  6. If the datatype is DT_NTEXT then change it to DT_STR.
  7. Repeat step 6 for the all the columns where if columns datatype is DT_NTEXT.

* Thanks to Ritesh Modi for the solution.

Posted in MS SQL.

Leave a Reply