Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:11:51+00:00 2026-06-04T17:11:51+00:00

I am trying to use XML Bulk Load (sql server 2008). I am almost

  • 0

I am trying to use XML Bulk Load (sql server 2008). I am almost there, but I think my schema file is wrong. The error I am getting is this:

VBS Error Msg

Here is what I have:

SQL Table Structure:

SQL Table Structure

Schema File:

<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data" 
    xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"  
    xmlns:sql="urn:schemas-microsoft-com:xml-sql" > 

    <ElementType name="weight" dt:type="string" />
    <ElementType name="fwd" dt:type="float" />
    <ElementType name="aft" dt:type="float" />

    <ElementType name="CGs" sql:is-constant="1">
        <element type="gross" />
    </ElementType>

    <ElementType name="gross"  sql:relation="tblCGLimits">
      <element type="weight"  sql:field="weight" />
      <element type="fwd" sql:field="fwd" />
      <element type="aft"        sql:field="aft" />
   </ElementType>
</Schema>

XML File:

<?xml version="1.0" encoding="utf-8" ?>
<CGs>
    <gross weight="8000">
        <fwd>196.5</fwd>
        <aft>208.88162</aft>
    </gross>
    <gross weight="8001">
        <fwd>196.495</fwd>
        <aft>208.8825148</aft>
    </gross>
    <gross weight="8002">
        <fwd>196.49</fwd>
        <aft>208.8834096</aft>
    </gross>
</CGs>

And the VBScript I am using:

Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=MyServer;database=MyDB;uid=MyUser;pwd=MyPW"
objBL.ErrorLogFile = "c:\XMLError.log"
objBL.Execute "c:\Schema.xml", "c:\CGLimits.xml"
Set objBL = Nothing
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:11:53+00:00Added an answer on June 4, 2026 at 5:11 pm

    Your XSD file specifies that weight values are elements, rather than attributes, which would look as follows:

    <?xml version="1.0" encoding="utf-8" ?>
    <CGs>
        <gross>
            <weight>8000</weight>
            <fwd>196.5</fwd>
            <aft>208.88162</aft>
        </gross>
        <gross>
            <weight>8001</weight>
            <fwd>196.495</fwd>
            <aft>208.8825148</aft>
        </gross>
        <gross>
            <weight>8002</weight>
            <fwd>196.49</fwd>
            <aft>208.8834096</aft>
        </gross>
    </CGs>
    

    To correct this, change

    <element type="weight" sql:field="weight"/>
    

    to

    <attribute type="weight" sql:field="weight"/>
    

    in the XSD file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the following code # LOAD XML FILE $XML = new
I'm trying to use the XML::LibXML::Schema to validate a xml file against a xsd.
I'm trying to use the XML DOM in CodeIgniter, but I can't load the
Trying to use JSTL but have the following problem: Index.xhtml page: <?xml version=1.0 encoding=UTF-8?>
I am trying to use dom4j to validate the xml at http://www.w3schools.com/Schema/schema_example.asp using the
I'm trying to use the lxml library to parse an XML file...what I want
I'm trying to use a playlist XML file with JW Player which requires crossdomain.xml
I'm trying to use the Xml Source to shred an XML source file however
I'm trying to use Simple XML to interpret a XML file. Teorically i must
I'm trying to use an xml file for spritesheet data; I have a frame

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.