vipin mudgal

vipin mudgal

  • NA
  • 7
  • 3k

move data from src db to target db table using xml mapper

Mar 10 2016 2:23 AM
 
using C#,Xml,Sql 
 
Suppose we have two xml file,one have define source connection string,target connection string and other one xml having define mapping between srcdb and trgt db.
1- I have to read source connection and target connection. make a connection based on consetting xml file.
Note:- you can also define your connection string in Consetting xml file
2- I have to read second mapper xml file,according to source connection and target connection find first what tables are attached in both src db and targetdb . ex.- OrderHDR table column OrderId - 101,102,103 please insert first manually in sql.
3- Check this condition which is given in second mapper xml file
<TargetSAMPLE.Sales.SaleID AlternateValue="" Formula="" ConstantValue="" TfkRelation="" Tfk="" Tpk="" Src="OPTICS_SQL.OrderHDR.OrderID"/>
Note: This means OrderHDR table feild OrderID assign to targetdb "TargetSample", table name "Sales" ,column name "SalesID"
Note: Here OPTICS_SQL is source connection string name
4- Insert OrderID all value which you read from src db to targetdb sales table column salesId.
Please find attachment below. and first see these xml file,i have also attached
sql script.

Attachment: new folder.rar