A
AmitDB
We have a table "Table1" in a database "DB1". There is one more table
"Table2" in different Dataabse "DB2". Table1 and Table2 have same
schema(Structure). From Table1 I want to transfer all the records
(Which may be 3-5 millions) to Table2.
My code goes like -
<For DB1>:
OledbAdapter DA1
DataSet DS1
DA1.Fill(DS1, "Table1") // With query "select * from table1"
<For DB2>:
OledbAdapter DA2
DataSet DS2
DA2.Fill(DS2, DS1.Table[0].TableName); // With query "select * from
table2 where 1=2"
DS2.ReadXml(new StringReader(DS1.GetXml()), XmlReadMode.IgnoreSchema);
DA2.Update(DS1, DS1.Table[0].TableName);
The code is working fine but when data is huge say 4-5 million, then it
is taking too muchh time to migrate. I think explicit conversion of XML
and then reading the same to Dastination DataSet may be time consuming.
There must be some other alternative which can speed up the process to
migrate the bulk data.
I am using DotNet1.2, which does not have bulk copy option
available......
"Table2" in different Dataabse "DB2". Table1 and Table2 have same
schema(Structure). From Table1 I want to transfer all the records
(Which may be 3-5 millions) to Table2.
My code goes like -
<For DB1>:
OledbAdapter DA1
DataSet DS1
DA1.Fill(DS1, "Table1") // With query "select * from table1"
<For DB2>:
OledbAdapter DA2
DataSet DS2
DA2.Fill(DS2, DS1.Table[0].TableName); // With query "select * from
table2 where 1=2"
DS2.ReadXml(new StringReader(DS1.GetXml()), XmlReadMode.IgnoreSchema);
DA2.Update(DS1, DS1.Table[0].TableName);
The code is working fine but when data is huge say 4-5 million, then it
is taking too muchh time to migrate. I think explicit conversion of XML
and then reading the same to Dastination DataSet may be time consuming.
There must be some other alternative which can speed up the process to
migrate the bulk data.
I am using DotNet1.2, which does not have bulk copy option
available......