Skip to content
Advertisement

How can I set the xml result to the nvarchar declaration in sql

I have the following sql , what I want is the return of the select to be assigned to the @NewCor Nvarchar , but I can’t make it work

Advertisement

Answer

I am so sure about the internal structure of your temp table, so you may need to tweak a few things to match your use case. But generally this should give you an idea of how to do that:

Basically:

  • Extract the data from XML, so you get a normal SQL table
  • The recursively combine the data
  • Finally: Assign the outcome (which is where Order is maxed) to a variable
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement