SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as well?



[Using assembly Interop.SQLXMLBULKLOADLib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=null]

Hello all,

A piece of software that was built for us by a 3rd party uses
SQLXMLBULKLOADLib to import records from an XML feed into our database. The
XML feed includes previously-imported records that may or may not have
changed, as well as new records. When we run the bulkload utility, it
inserts duplicate records for those previously-imported, so to avoid this,
we have resorted to emptying out each table prior to running the bulkload
utility. This is not desirable because the tables often contain records that
were added through another source, such as the web interface.

I wonder if there isn't a way to accomplish the bulkload without dumping the
contents first? Each record contains a unique field that can be used as a
primary key, however, the original developer did not specify the field as a
primary key in the table. If I set the field as a primary key in the table,
can the bulkload be configured so that when it processes the nodes in the
XML file, it updates existing records and only inserts when the record
doesn't already exist in the table?

Because I didn't originally write this code, I would prefer to keep my
revisions to a minimum, unless there is a much better way of importing the
XML feed into our database that I can write fairly quickly.

Also, I was wondering if there is a utility to quickly generate XSD schemas
to use in the bulkload from the actual tables in SQL Server. I'd like to
modify our schemas to include the relationships and keys that I've set up
using the Management Console, but would much rather avoid doing it manually.
Please advise.

Thank you!
-Sabrina


.



Relevant Pages

  • RE: loading xml into sql using bulkload
    ... Do you think I could get a copy of the zip file to use XML bulk load. ... > public void CallStoredProc ... I've got a c# class with the bulkload code ... >> the istream interface for that second parameter. ...
    (microsoft.public.biztalk.general)
  • Re: BulkLoad Validation
    ... Then you could pass it to bulkload. ... Irwin Dolobowsky ... what should I do to load and verify the XML data. ... >>>> The SQLXMLBulkload component does not validate the input XML ...
    (microsoft.public.sqlserver.xml)
  • Re: Restrictions on Bulk Load of XML in SQLXML3sp2
    ... bulkload does not support use="prohibited". ... >I know bulk load does not validate the XML against the schema, ... > table without it being present in the XML. ...
    (microsoft.public.sqlserver.xml)
  • Re: XSD Schema for BulkLoad
    ... in bulkload you'd have to do an XSL transform or run it through something ... bulkload needs a schema to schema mapping. ... >> schema names as attribute values, you first need to transform your XML ...
    (microsoft.public.sqlserver.xml)
  • Re: Why Generics?
    ... primary key and table-specific data. ... our very first non-trivial JDBC program ever. ... so if I spent time refactoring before turning it in I would ... the syntax for table relationships in XML and then learn how to parse ...
    (comp.lang.java.programmer)

Loading