Have a look at the entry for OPENXML in BOL, sqlpgmr. It's pretty thorough.Basically, the flag controls what is mapped to the columns in your resultset. Take the following examples:DECLARE @DocHandle intDECLARE @XmlDocument nvarchar(1000)SET @XmlDocument = N'<ROOT> <Customer CustomerID="1" LastName="Davidson" FirstName="Mark"> </Customer> <Customer CustomerID="2" LastName="Smith" FirstName="Bob"> </Customer></ROOT>'-- Create an internal representation of the XML document.EXEC sp_xml_preparedocument @DocHandle OUTPUT, @XmlDocument-- Execute a SELECT statement using OPENXML rowset provider.SELECT *FROM OPENXML (@DocHandle, '/ROOT/Customer',1) WITH (CustomerID int, LastName varchar(20), FirstName varchar(20))EXEC sp_xml_removedocument @DocHandleSET @XmlDocument = N'<ROOT> <Customer> <CustomerID>1</CustomerID> <LastName>Davidson</LastName> <FirstName>Mark</FirstName> </Customer> <Customer> <CustomerID>2</CustomerID> <LastName>Smith</LastName> <FirstName>Bob</FirstName> </Customer></ROOT>'-- Create an internal representation of the XML document.EXEC sp_xml_preparedocument @DocHandle OUTPUT, @XmlDocument-- Execute a SELECT statement using OPENXML rowset provider.SELECT *FROM OPENXML (@DocHandle, '/ROOT/Customer',2) WITH (CustomerID int, LastName varchar(20), FirstName varchar(20))EXEC sp_xml_removedocument @DocHandle
As you can see, you get the same result from two different XML documents by specifying attribute-centric or element-centric mapping.Mark