Hi,
I do have some experience of loading XML into SQL server, but have come up against a problem and would appreciate some help. The XML I am trying to load is:
<WorkerManagement>
<Worker>
<WorkerID>1234</WorkerID>
<LegalName>
<Name Location="First" TypeCode="GivenName">GLORIA</Name>
<Name Location="Middle" TypeCode="GivenName">EDITH</Name>
<Name Location="Last" TypeCode="FamilyName">HERNANDEZ</Name>
<Name Location="Last" TypeCode="FamilyName">MARTINEZ</Name>
<Name Location="First" TypeCode="Initial">GH</Name>
</LegalName>
<WorkerTitle>aa</WorkerTitle>
<SecurityIdentifier TypeCode="BadgeNumber">00</SecurityIdentifier>
<SecurityIdentifier TypeCode="Password"> ************</SecurityIdentifier>
<PayRollID>640085</PayRollID>
<Classification FulltimeFlag="false" WorkerTypeID="1"></Classification>
<EffectiveDate>2001-01-01</EffectiveDate>
<ExpirationDate></ExpirationDate>
</Worker>
</WorkerManagement>
The lines that are giving me a problem are the ones starting "<Name Location...". I cannot get the actual Name (e.g.GLORIA, EDITH etc.) to load.
I am using SQL 2012 and using sp_xml_preparedocument to load the XML from a variable.
Any help would be much appreciated.
I do have some experience of loading XML into SQL server, but have come up against a problem and would appreciate some help. The XML I am trying to load is:
<WorkerManagement>
<Worker>
<WorkerID>1234</WorkerID>
<LegalName>
<Name Location="First" TypeCode="GivenName">GLORIA</Name>
<Name Location="Middle" TypeCode="GivenName">EDITH</Name>
<Name Location="Last" TypeCode="FamilyName">HERNANDEZ</Name>
<Name Location="Last" TypeCode="FamilyName">MARTINEZ</Name>
<Name Location="First" TypeCode="Initial">GH</Name>
</LegalName>
<WorkerTitle>aa</WorkerTitle>
<SecurityIdentifier TypeCode="BadgeNumber">00</SecurityIdentifier>
<SecurityIdentifier TypeCode="Password"> ************</SecurityIdentifier>
<PayRollID>640085</PayRollID>
<Classification FulltimeFlag="false" WorkerTypeID="1"></Classification>
<EffectiveDate>2001-01-01</EffectiveDate>
<ExpirationDate></ExpirationDate>
</Worker>
</WorkerManagement>
The lines that are giving me a problem are the ones starting "<Name Location...". I cannot get the actual Name (e.g.GLORIA, EDITH etc.) to load.
I am using SQL 2012 and using sp_xml_preparedocument to load the XML from a variable.
Any help would be much appreciated.