SQLXMLBULKLOAD relationship expected

Posted on 2009-12-30
Last Modified: 2012-05-08
Runniing SQLXMLBULKLOAD I have the following error message
Schema: relationship expected on 'product'.
As I am just writing to the one table (InputGlobalFeed) i dont believe that I need to set up any reationships,and cannot think of ones I could set up. Can anyone spot where this XSD schema is going wrong?

<xsd:schema xmlns:sql="urn:schemas-microsoft-com:mapping-schema" xmlns:xsd="">

  <xsd:element name="products">



        <xsd:element sql:relation="InputGlobalFeed" name="product">



              <xsd:element sql:field="IGFMerchantProductName" name="ProductName" type="xsd:string" />

              <xsd:element sql:field="IGFProductPrice" name="ProductPrice" type="xsd:string" />

              <xsd:element sql:field="IGFProductDescription" name="ProductDescription" type="xsd:string" />

              <xsd:element sql:field="IGFSummaryDescription" name="SummaryDescription" type="xsd:string" />

              <xsd:element sql:field="IGFBrand" name="BrandName" type="xsd:string" />

              <xsd:element sql:field="IGFGender" name="Gender" type="xsd:string" />

              <xsd:element sql:field="IGFSalesRank" name="SalesRank" type="xsd:string" />

              <xsd:element sql:field="IGFDelivery" name="Delivery" type="xsd:string" />

              <xsd:element sql:field="IGFMerchantProductId" name="ProductID" type="xsd:string" />

              <xsd:element sql:field="IGFAffiliateURL" name="AffiliateURL" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL" name="ImageURL" type="xsd:string" />

              <xsd:element sql:field="IGFProductAddedDate" name="ProductAddedDate" type="xsd:string" />

              <xsd:element sql:field="IGFProductUpdatedDate" name="ProductUpdatedDate" type="xsd:string" />

              <xsd:element sql:field="IGFCategory" name="Category" type="xsd:string" />

              <xsd:element sql:field="IGFMerchantName" name="MerchantName" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL50by50" name="ImageURL50by50" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL100by100" name="ImageURL100by100" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL120by120" name="ImageURL120by120" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL200by200" name="ImageURL200by200" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL234by234" name="ImageURL234by234" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL300by300" name="ImageURL300by300" type="xsd:string" />

              <xsd:element sql:field="IGFImageURL400by400" name="ImageURL400by400" type="xsd:string" />








Open in new window

Question by:Simon Cripps
    LVL 22

    Expert Comment


    you need to check your db structure well.. your table must be having column referencing other tables..

    Accepted Solution

    All columns on db were checked and matched the XML structure.
    As I am using just one table here I could not see how the relationship was required.

    The solution came from updating the <xsd:element name="products"> to include  sql:is-constant="1"
    Looking at this makes sure that the element is not maped to any SQL field. Therefor I suspect that as this was not included in the origional XSD the Bulk Load read that Products was to be related to on parent table and Product to a child table. Setting sql:is-constant="1" resolved this as just requireing one table.

    Author Comment

    by:Simon Cripps
    Have now changed this to SQLXMLBULKLOAD and after some time setting it up have come to a solution mapping the elements to the fields. A lot of work but a better solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: and…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now