Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to show both attributes and elements using OPENXML

Status
Not open for further replies.

manohars

Programmer
Feb 28, 2004
97
US
Is it possible to show both attributes and elements using OPENXML? How can this be done?

Thanks,
Manohar
 
Have a look at BOL, specifically the openXML statement. There is an additional parameter when using openXML allowing a choice of 4 options:
0 - Default to attribute centric mapping
1 - Specify the Attribute centric mapping
2 - Element centric
3 - combined attribute and element.

To use it do something like
Code:
SELECT    *
FROM       OPENXML (@idoc, '/ROOT/Customer',3)--the 3 denotes combined.
            WITH (CustomerID  varchar(10),
                  ContactName varchar(20))

"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top