Yes, SQL 2005 XML DML is not as powerful as 2008. They've added support for
XML variables/columns in 2008. Here's something I would think should work,
but for some reason doesn't:
UPDATE table2 -- modify method *should* insert a new node for each
@member_id attribute,
-- but it stops after one for some reason
SET Member.modify('insert
before (/group/member)[1]')
FROM ( -- Subquery returns all @member_id attributes from the source table
SELECT x.value('(@member_id)[1]', 'INT') AS member_id
FROM table1
CROSS APPLY table1.Member.nodes('/group/member') T(x)
WHERE pk_column_id = 37
) z
WHERE table2.pk_column_id = 16;
I'm probably overlooking something obvious, but this update with the XML DML
statement only inserts a single node from table1 to table2, when it should
be inserting them all. I'm probably missing something really obvious
here...
gmail.com> wrote in message news:18e074a1-d096-4b2e-8
01b-a6217175e194@e10g2000prf.googlegroups.com...
> Thanks, Mike.
>
> This works for 1 node:
>
>
> DECLARE @insertStmt nvarchar(MAX)
> DECLARE...