dcsimg
www.webdeveloper.com
Results 1 to 1 of 1

Thread: Using sqlxmlbulk load and check for existing records

  1. #1
    Join Date
    Feb 2008
    Posts
    12

    Using sqlxmlbulk load and check for existing records

    Hi,

    I'm using sqlxml bulk load 3.0 to import some xml. I'm just wondering if there is a way (either in the mappng schema, or the script itself) to check if the record already exists? or if theres any other suggestions on how i could update my table from the xml.

    script

    Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
    objBL.ConnectionString = "provider=SQLOLEDB.1;data source=ip;database=products;uid=sa;pwd=test"
    objBL.ErrorLogFile = "c:\xml\error.log"
    objBL.Execute "c:\xml\productmapping.xml", "c:\xml\products.xml"

    MsgBox "XML imported to sql server!", "0", "XML imported to sql server"

    Set objBL = Nothing



    schema

    <?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="ID" dt:type="int" />
    <ElementType name="event_token" dt:type="char" />
    <ElementType name="event_desc" dt:type="nvarchar" />

    <ElementType name="event_list" sql:is-constant="1">
    <element type="event" />
    </ElementType>

    <ElementType name="event" sql:relation="products">
    <element type="event_token" sql:field="event_token" />
    <element type="event_desc" sql:field="event_desc" />
    </ElementType>

    </Schema>

    thanks
    Last edited by emmetmurray; 06-24-2008 at 09:03 AM. Reason: title change

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles