BCP Export Missing XML Declaration

  • I am using BCP to export the contents of a column that has an XML datatype to an XML file. Everything is working fine except the XML file is missing the XML Declaration ( ). I have been trying everything I can think of and nothing seems to work. I must be missing something obvious because in most cases XML files will need the declaration. Does anyone know how to get the declaration in the file?

    A new file is created each export.

  • To clarify: I understand that the XML datatype strips out the XML Declaration and white space. I am not trying to store that in the database; I just want to add it back in the export file when it is created so that it will be well-formed.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply