XML question.

  • How to output <?xml version="1.0"?>  from a stored procedure

    select (

    ---all my XML queries are here
    )
    AS COL_XML

    But the output does not generate the  <?xml version="1.0"?>  . How can I add that to the XML query?

  • Guras - Friday, December 1, 2017 7:18 AM

    How to output <?xml version="1.0"?>  from a stored procedure

    select (

    ---all my XML queries are here
    )
    AS COL_XML

    But the output does not generate the  <?xml version="1.0"?>  . How can I add that to the XML query?

    You can do this by converting the XML to a character data type, no can do if the data type is XML
    😎

  • Figured this out and here is the solution .It may help somebody some day.

    declare @xmlstr  xml
    set @xmlstr 
    =  ---all my XM query here

    select '<?xml version="1.0" >' + cast(@xmlstr as varchar(max)) as COL_XML

  • Eirikur Eiriksson - Friday, December 1, 2017 7:42 AM

    Guras - Friday, December 1, 2017 7:18 AM

    How to output <?xml version="1.0"?>  from a stored procedure

    select (

    ---all my XML queries are here
    )
    AS COL_XML

    But the output does not generate the  <?xml version="1.0"?>  . How can I add that to the XML query?

    You can do this by converting the XML to a character data type, no can do if the data type is XML
    😎

    Thank you!

  • Guras - Friday, December 1, 2017 8:16 AM

    Eirikur Eiriksson - Friday, December 1, 2017 7:42 AM

    Guras - Friday, December 1, 2017 7:18 AM

    How to output <?xml version="1.0"?>  from a stored procedure

    select (

    ---all my XML queries are here
    )
    AS COL_XML

    But the output does not generate the  <?xml version="1.0"?>  . How can I add that to the XML query?

    You can do this by converting the XML to a character data type, no can do if the data type is XML
    😎

    Thank you!

    You are welcome.
    😎

Viewing 5 posts - 1 through 4 (of 4 total)

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