Home Forums SQL Server 2008 T-SQL (SS2K8) How can I add encoding in output XML file like "<?xml version="1.0" encoding="ISO-8859-1"?>" RE: How can I add encoding in output XML file like "<?xml version="1.0" encoding="ISO-8859-1"?>"

  • Its' a select statement directly from table with fields

    Select doc.col1, doc.col2, doc.col3

    from TestTable as doc

    for xml path ('doc')

    the result is one XML column or you can say it's one column, I didn't try your way but not working, see below:

    SELECT ('<?xml version="1.0" encoding="iso8859-1"?>') for xml path ('')

    UNION ALL

    Select doc.col1, doc.col2, doc.col3

    from TestTable as doc

    for xml path ('doc')