Loading XML fails with "unable to switch the encoding"
Package reads a single XML file that I've found has to be read as a NON-Unicode file, thus having a DT_TEXT column output, which must go through a Data Conversion to DT_NTEXT so the Native SQL Client 10.0connection will accept the data, but that's a sorry tale... When the package is finally "valid", upon execution I get the following "rejected!"...: [SQL Server Destination [57]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80040E14 Description: "XML parsing: line 1, character 38, unable to switch the encoding". The File starts with: <?xml version="1.0" encoding="UTF-8"?> <UPDATE_PICKLIST_006> <CNTROLAREA> ... What and where do I need to change "something"to get this into an XML column in my destination table? The file is from an outside vendor, so content of the first line is not negotiable...
October 23rd, 2008 9:30pm

Hi, when u get the file from your vendor you can manipulate it in your variable before you try to upload it to the db lets say some string for example string str1= "<?xml version=\"1.0\" encoding=\"UTF-8\"?> .. . .. . . .. . . .. . . .. "; now you just need to replace this line UTF-8 with this one UTF-16 str1.Replace("UTF-8", "UTF-16") I think this will helpgood luck
Free Windows Admin Tool Kit Click here and download it now
December 1st, 2008 10:21am

Vendor changed the file so no UTF is declared. Changed the way the file is processed so it split the multi-document file using the <?xml... string. Encoding issue went away.
July 22nd, 2011 12:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics