December 1, 2017 at 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?
December 1, 2017 at 7:42 am
Guras - Friday, December 1, 2017 7:18 AMHow to output <?xml version="1.0"?> from a stored procedure
select (
---all my XML queries are here
)
AS COL_XMLBut 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
😎
December 1, 2017 at 7:43 am
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
December 1, 2017 at 8:16 am
Eirikur Eiriksson - Friday, December 1, 2017 7:42 AMGuras - Friday, December 1, 2017 7:18 AMHow to output <?xml version="1.0"?> from a stored procedure
select (
---all my XML queries are here
)
AS COL_XMLBut 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!
December 1, 2017 at 8:20 am
Guras - Friday, December 1, 2017 8:16 AMEirikur Eiriksson - Friday, December 1, 2017 7:42 AMGuras - Friday, December 1, 2017 7:18 AMHow to output <?xml version="1.0"?> from a stored procedure
select (
---all my XML queries are here
)
AS COL_XMLBut 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