Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 SQL Bulkload mapping question

Author  Topic 

Vishakha
Starting Member

40 Posts

Posted - 2007-01-29 : 05:27:17
I want to import an xml file into database following is the mapping

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xsd:annotation>
<xsd:appinfo>


<sql:relationship name="EnEnc"
parent="EncounterMaster"
parent-key="MasterId"
child="Enc"
child-key="MasterId"
/>

<sql:relationship name="EnctrI"
parent="Encounter"
parent-key="ClaimId"
child="InstitutionalDetail"
child-key="ClaimId"
/>
<sql:relationship name="EnctrP"
parent="Encounter"
parent-key="ClaimId"
child="ProfessionalClaim"
child-key="ClaimId"
/>
<sql:relationship name="InstDiag"
parent="InstitutionalDetail"
parent_key="InstitutionalProviderId"
child="Diagnosis"
child-key="InstitutionalProviderId"
/>
<sql:relationship name="InstProcedure"
parent="InstitutionalDetail"
parent_key="InstitutionalProviderId"
child="Procedure"
child-key="InstitutionalProviderId"
/>
<sql:relationship name="InstProvider"
parent="InstitutionalDetail"
parent_key="InstitutionalProviderId"
child="provider"
child-key="InstitutionalProviderId"
/>
<sql:relationship name="ProffDet"
Parent="ProfessionalClaim"
parent-key="ReferringProviderId"
child="ProfessionalDetail"
child-key="ReferringProviderId"
/>
<sql:relationship name="ProffDiag"
Parent="ProfessionalClaim"
parent-key="ReferringProviderId"
child="Diagnosis"
child-key="ReferringProviderId"
/>
<sql:relationship name="ProffProc"
Parent="ProfessionalClaim"
parent-key="ReferringProviderId"
child="Procedure"
child-key="ReferringProviderId"

/>
</xsd:appinfo>
</xsd:annotation>


This mapping works fine if my xml has all the elements. But if say some elements or nodes don't have any values like for relation "EnctrP" then it inserts nulls in the table.
Is there a way to avoid these nulls.
or is there a way to tell bulkload not to insert into database if the node is empty or element doesn't have a value, but is there as a place holder.

Thanks in advance for your help.

   

- Advertisement -