I have a temp table that contains values I want injected as elements into a SQL Server column. I can do this for one entry using the modify and insert statements. But how can I do this for multiple rows in a table?
Some sample data looks like this:
SerializedTable
:
ID SerializedXML
-----------------------------------------
7 <Form> <Field1>111</Field1> </Form>
8 <Form> <Field1>112</Field1> </Form>
#TempTable
:
ID FK_ID Value
--------------------
1 7 120
2 8 124
So I need to add a new element to SerializedXML
with the values in the value column.
So the final table would look like:
SerializedTable
:
ID SerializedXML
---------------------------------------------------------------
7 <Form> <Field1>111</Field1> <Field2>120</Field2> </Form>
8 <Form> <Field1>112</Field1> <Field2>124</Field2> </Form>
The name of the element will be the same for all of the new inserted fields.