Answer the question
In order to leave comments, you need to log in
How to write the generated xml document to a string?
I generated an xml document using the for xml function, where can I save the result? When trying to add insert into / select into to the query or assigning the result to a variable, it says that these constructs cannot be used with for xml. How to proceed then?
Answer the question
In order to leave comments, you need to log in
Declare @xml as xml
, @str as nvarchar(max)
select @xml = (select ... for xml)
select @str = cast(@xml as nvarxhar(max))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question