SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as well?
- From: "Sabrina Veksler" <Sabrina.Veksler@xxxxxxxxxxxxxxxx>
- Date: Mon, 3 Nov 2008 09:57:28 -0500
[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
.
- Follow-Ups:
- RE: SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as
- From: Bob
- RE: SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as well?
- From: "Charles Wang [MSFT]"
- RE: SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as
- Next by Date: RE: SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as well?
- Next by thread: RE: SQLXMLBULKLOAD question: Does it INSERT only, or can it UPDATE as well?
- Index(es):
Relevant Pages
|
Loading