Monday, March 19, 2012

mixed mapping & OPENXML

Hi All,
Does anyone know what comination of OPENXML(blah, blah) WITH (blah, blah) st
atement I need to use in order to get the values out of the following XML te
xt:
<Root>
<Contact Name="username1" />
<Contact>
<Name>username2</Name>
</Contact>
</Root>
TIA
Goran DjuranovicOf course, other than:
SELECT * FROM OPENXML (@.idoc, '/ROOT/Contact',3)
WITH (
Name1 varchar(10) '@.Name',
Name2 varchar(10) 'Name'
)
and checking whichever one is not NULL, to take that one.
----
--
"Goran Djuranovic" <djurag@.mmcREMOVE_TO_MAIL.org> wrote in message news:OI0f
seJPGHA.1696@.TK2MSFTNGP14.phx.gbl...
Hi All,
Does anyone know what comination of OPENXML(blah, blah) WITH (blah, blah) st
atement I need to use in order to get the values out of the following XML te
xt:
<Root>
<Contact Name="username1" />
<Contact>
<Name>username2</Name>
</Contact>
</Root>
TIA
Goran Djuranovic|||And, other than:
SELECT
Name = IsNull(Name1, Name2)
FROM OPENXML (@.idoc, '/ROOT/Contact',3)
WITH (
Name1 varchar(10) '@.Name',
Name2 varchar(10) 'Name'
)
TIA
Goran Djuranovic
"Goran Djuranovic" <djurag@.mmcREMOVE_TO_MAIL.org> wrote in message news:OI0f
seJPGHA.1696@.TK2MSFTNGP14.phx.gbl...
Hi All,
Does anyone know what comination of OPENXML(blah, blah) WITH (blah, blah) st
atement I need to use in order to get the values out of the following XML te
xt:
<Root>
<Contact Name="username1" />
<Contact>
<Name>username2</Name>
</Contact>
</Root>
TIA
Goran Djuranovic|||I took "the below" as a solution.
-G
"Goran Djuranovic" <djurag@.mmcREMOVE_TO_MAIL.org> wrote in message news:O3sM
lvJPGHA.3888@.TK2MSFTNGP12.phx.gbl...
And, other than:
SELECT
Name = IsNull(Name1, Name2)
FROM OPENXML (@.idoc, '/ROOT/Contact',3)
WITH (
Name1 varchar(10) '@.Name',
Name2 varchar(10) 'Name'
)
TIA
Goran Djuranovic

No comments:

Post a Comment