Transfer of Data from Sql Server database to mysql with different table structure

Posted by Geetha under ASP.NET on 9/23/2009 | Views : 1809 | Status : [Member] | Replies : 5
Hi,

Iam using SQL server 2005 and mysql 5.0 version.
I need to transfer data from Table1 of sql server to Table2 of Mysql of different table structures.
I have read an article form the above mentioned site
http://www.dotnetfunda.com/articles/article60.aspx

In this he assumed that if the table structure is of same but my requirement is that i want to transfer data from sql to mysql of different tables structures.
In this case mapping of columns should be done.
how do i proceed in this regard?

Thanks and Regards
Geetha




Responses

Posted by: Swethavithal on: 12/9/2011 [Member] Starter | Points: 25

Up
0
Down
foreach (DataRow row in SqldSet.Tables["students"].Rows)
{

MySqldSet.Tables[0].NewRow();

MySqldSet.Tables[0].Rows.Add(row.ItemArray);

}
here am getting IndexOutOfRangeException
can any1 help plz

Thanks & Regards
------------------------
swetha

Geetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kirti.Darji on: 9/24/2009 [Member] Starter

Up
0
Down
use DTS Package in SQl


Regards
Kirti Darji

Kirti M. Darji
Senior Software Developer
http://kirtimdarji.blogspot.com/

Geetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Geetha on: 9/24/2009 [Member] Starter

Up
0
Down
Thanks for the reply.
How can i do the same thing without using any services like DTS in sql and SSIS in Mysql?
I want do in ASP.Net.
Plz reply me ASAP.

Geetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kirti.Darji on: 9/25/2009 [Member] Starter

Up
0
Down
see following link it may help you

http://codegain.com/index.php?option=com_content&view=article&id=194:export-data-from-sql-server-to-ms-access&catid=131:t-sql&Itemid=154


Regards
Kirti Darji

Kirti M. Darji
Senior Software Developer
http://kirtimdarji.blogspot.com/

Geetha, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rtpharry on: 9/25/2009 [Member] [MVP] Bronze

Up
0
Down
Hey, it seems that this part of the code in the article is responsible for the actual cross-pollination:


foreach (DataRow row in SqldSet.Tables["myTables"].Rows)
{
MySqldSet.Tables[0].NewRow();
MySqldSet.Tables[0].Rows.Add(row.ItemArray);
}


It just needs expanding so it looks for a specific column of each row on the tsql database and puts it in a column of the mysql data set.

I dont use ado.net for my data access so I dont know the coding for this off the top of my head but it should be pretty straightforward as nearly all ado.net code looks the same :)

Geetha, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response