June 2, 2009 at 8:31 am
Thanks for the interesting example of what happens when you mix attribute-centric and element-centric mapping in one xml structure.
June 2, 2009 at 10:10 am
The use of XQuery would be better vs. OPENXML which is generally considered to be obsolete. It is more readable which helps to avoid errors.
Additionally, OPENXML is a resource hog. See the SQLServerCentral article:
June 2, 2009 at 5:25 pm
Answering Carla's question directly - try the following:
SELECT
*
FROM OPENXML (@hdoc, '/test/value',3)
WITH (id int,
name varchar(10),
class int,
flag char(1))
i.e. the flags Argument can be a combination of Byte Values (1 (attribute-centric) and 2 (element-centric))
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply