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



Sabrina,

I would recommend bulk loading your data to a staging table first and then
using SQL to work out which records need to be inserted or updated. You can
use traditional LEFT JOIN, EXISTS or the EXCEPT operators to work out which
records are already there.

Also, in SQL 2008 you can use the new MERGE statement.

XSD.exe supplied with Visual Studio ( eg C:\Program Files\Microsoft Visual
Studio 8\SDK\v2.0\Bin\xsd.exe ) can create schemas, however they may not
immediately work with SQL Server. I have been opening up the Schemas in
Visual Studios visual designer to see the relationships and then adding them
manually to the xsd file based on the diagram Visual Studio shows me.

I understand there are some tools available, eg SchemaTron, XMLSpy(?) or
related tool, but I have never used them.

Hope that makes sense.

wBob

"Sabrina Veksler" wrote:

[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: TQL Debugger im SQL Server 2005
    ... SQL Client Verbindung ist mit dem "sa" erstellt. ... im Visual Studio - new Project - habe ich keine Database ... >> Ich habe den SQL Server 2005 Developer Edition mit SQL Server Database ... >> Services, Analysis Services, Integration Services und Client ...
    (microsoft.public.de.sqlserver)
  • Re: TQL Debugger im SQL Server 2005
    ... >>> Ich habe den SQL Server 2005 Developer Edition mit SQL Server ... >>> Database Services, Analysis Services, Integration Services und ... Ich habe ebenfalls Visual Studio 2005 ...
    (microsoft.public.de.sqlserver)
  • Visual Studio 2005 - VB or C#, etc - SOME ONE PLEASE EXPLAIN..
    ... I do development work in Ms Access using VBA and new to SQL Server and now ... learning what Visual Studio 2005 has to offer. ... In my mind Ms Access does so many little steps in the background for you (via ... the steps that Ms Access tools offer.(unless you are an advance programmer)? ...
    (comp.lang.basic.visual.misc)
  • Re: Business objects, subset of collection
    ... we have schemas of objects (a set of rules that define the ... SQL works on not normalised data ... payment, please now execute their request payment routines (remember, ... That is why encapsulating is a bad thing in this case. ...
    (comp.object)
  • Re: Access Application to Visual Studio
    ... let me say that one side of me is very impressed with Visual Studio ... does some interesting manipulations and uploads all the data to a SQL ... create the order / order detail form from ... deal with resolving those concurrency conflicts with your disconnected ...
    (microsoft.public.vstudio.general)