hello to all,
Im trying to load xml file to sql server but I dont have enough knowledge how to create schema xml, as of now im using vbscript program to upload my xml,
here is my vbscript codings,
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=codevelopment;database=Johnny;uid=restorer;pwd="
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\customermapping.xml", "c:\customers.xml"
Set objBL = Nothing
here is my customers.xml;
<ROOT>
<Customers CustomerId="1111" CompanyName="Test 2" City="NY" />
<Customers CustomerId="1234" CompanyName="Test 1" City="PH" />
<Customers CustomerId="1432" CompanyName="Test 3" City="ML" />
</ROOT>
and here is my xml 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="ROOT" sql:is-constant="1">
<element type="Customers" />
</ElementType>
<ElementType name="Customers" sql:relation="Customer">
<element type="CustomerId" sql:field="CustomerId" />
<element type="CompanyName" sql:field="CompanyName" />
<element type="City" sql:field="City" />
</ElementType>
</Schema>
any help will be appreciated...