how to use sql schema?

teenflesh

New Member
This is my sql table\[code\]CREATE TABLE Cust( CustomerID int PRIMARY KEY, CompanyName varchar(20), City varchar(20));CREATE TABLE CustOrder( OrderID int PRIMARY KEY, CustomerID int FOREIGN KEY REFERENCES Cust(CustomerID));\[/code\]This is my sqlxml.xml file\[code\] <?xml version="1.0" encoding="utf-8" ?> <ROOT> <Customers> <CustomerID>1111</CustomerID> <CompanyName>Sean Chai</CompanyName> <City>NY</City> <Order OrderID="1" /> <Order OrderID="2" /> </Customers> <Customers> <CustomerID>1112</CustomerID> <CompanyName>Tom Johnston</CompanyName> <City>LA</City> <Order OrderID="3" /> </Customers> <Customers> <CustomerID>1113</CustomerID> <CompanyName>Institute of Art</CompanyName> <Order OrderID="4" /> </Customers></ROOT>\[/code\]Below is the sqlschema.xml\[code\] <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"> <xsd:annotation> <xsd:appinfo> <sql:relationship name="CustCustOrder" parent="Cust" parent-key="CustomerID" child="CustOrder" child-key="CustomerID" /> </xsd:appinfo> </xsd:annotation> <xsd:element name="ROOT" sql:is-constant="1" > <xsd:complexType> <xsd:sequence> <xsd:element name="Customers" sql:relation="Cust" > <xsd:complexType> <xsd:sequence> <xsd:element name="CustomerID" type="xsd:integer" /> <xsd:element name="CompanyName" type="xsd:string" /> <xsd:element name="City" type="xsd:string" /> <xsd:element name="Order" sql:relation="CustOrder" sql:relationship="CustCustOrder" > <xsd:complexType> <xsd:attribute name="OrderID" type="xsd:integer" /> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element></xsd:schema>\[/code\]This is my vbscript\[code\]Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")objBL.ConnectionString = "provider=SQLOLEDB.1;data source=MySQLServer;database=MyDatabase;uid=MyAccount;pwd=MyPassword"objBL.ErrorLogFile = "c:\error.log"objBL.Execute "c:\sqlschema.xml", "c:\sqlxml.xml"Set objBL = Nothing\[/code\]The above codes and sql schema also working fine ..My question isif i update my table like below\[code\]CREATE TABLE Cust( Customer_ID int PRIMARY KEY, Company_Name varchar(20), City varchar(20));CREATE TABLE CustOrder( Order_ID int PRIMARY KEY, Customer_ID int FOREIGN KEY REFERENCES Cust(Customer_ID));\[/code\]I update \[code\]CustomerID to Customer_ID, CompanyName to Company_Name and OrderID to Order_ID\[/code\]In this cause how i update my schema ?
 
Back
Top