Importing attribute data into SQL Server 2000 with Bulk Load 
Author Message
 Importing attribute data into SQL Server 2000 with Bulk Load

I have been working with the Customer sample for doing a
Bulk Load of XML data into SQL Server.  Well, I am able to
get it to work with the sample XML file, but when I change
the file to put the data into attributes rather than
elements, I have not been able to get it to work.

Here is a sample of the XML file:
<ROOT>
  <Customers>
    <CustomerID value="1111" />
    <CompanyName value="company one" />
    <City value="NY" />
  </Customers>
  <Customers>
    <CustomerID value="1112" />
    <CompanyName value="company two" />
    <City value="LA" />
  </Customers>
  <Customers>
    <CustomerID value="1113" />
    <CompanyName value="company three" />
    <City value="NY" />
  </Customers>
</ROOT>

I am just not sure how to set-up the XSD file for
importing it into the database.  Any suggestions would be
greatly appreciated.



Sat, 05 Nov 2005 01:25:02 GMT
 Importing attribute data into SQL Server 2000 with Bulk Load


Quote:
> I have been working with the Customer sample for doing a
> Bulk Load of XML data into SQL Server.  Well, I am able to
> get it to work with the sample XML file, but when I change
> the file to put the data into attributes rather than
> elements, I have not been able to get it to work.

Bulk Load doesn't like the format you're trying to use (I'd call it an
element/attribute mixed style). Rather than spending a lot of time trying to
make your style work, I'd work on developing an XSL document that transforms
your XML style into an XML style that Bulk Load likes. This will make things
easier for you in the long run.

Note: there very well could be a way to map your style using XSD, but I
don't know of any off the top of my head so I'm putting forth my suggestion
as the easy way out.

--
Bryant



Sat, 05 Nov 2005 06:32:40 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. XML Bulk Load of a header element into two SQL Server 2000 tables

2. Loading data in SQL Server with BULK INSERT

3. <schema> attributes and Bulk Loading

4. Bulk Load Default value for an attribute

5. Bulk Load and xsd:default attribute doesn't work

6. Importing SQL 7.0 Data into SQL Server 2000

7. SQL Bulk Load Import - with attachment

8. How to save and load big data to image type in SQL Server 2000

9. Using updategrams to load data in SQL Server 2000

10. How to Import/Export/Load data in SQL Server

11. Importing data from XML file into SQL Server 2000

12. SQL Server 2000: Potential Import Data Wizard BUG


 
Powered by phpBB® Forum Software