This is a discussion on Copy data from MsSql database to a MySql database in batch mode. within the MySQL forums, part of the Database Server Software category; --> Hi all, anyone can say me something for give me the right way in obtain what i put in ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, anyone can say me something for give me the right way in obtain what i put in the object? The batch procedure must run on a Linux Box. In this linux box, there are operative php page that read from the MsSql database, and all works good (mssql_connect, mssql_select_db .... ) What i need is create a copy of some tables from the MsSql db to one new MySql db. The MySql db can be renew all the time that the batch procedure run. Thanks at all for your collaboration, regards, Mauro. |
| |||
| Mauro wrote: > Hi all, > anyone can say me something for give me the right way in obtain what i put > in the object? > The batch procedure must run on a Linux Box. > In this linux box, there are operative php page that read from the MsSql > database, and all works good (mssql_connect, > mssql_select_db .... ) > What i need is create a copy of some tables from the MsSql db to one new > MySql db. > The MySql db can be renew all the time that the batch procedure run. > Thanks at all for your collaboration, > regards, I think this may have been better asked at alt.php.sql. $mysql="DELETE FROM table"; mysql_query($mysql); $mssql="SELECT * FROM table"; $msres=mssql_query($mssql); while($row=mssql_fetch_row($msres)) { $mysql="INSERT INTO table VALUES('{$row[0]}','{$row[1]}',...)"; mysql_query($mysql); } I do suggest you would make the following changes to the code: 1. Make a backup of the table in mysql before you delete all rows from it. 2. In the php code, make error checks and return both query and error, if there would be some kind of error -- //Aho |
| |||
| > I think this may have been better asked at alt.php.sql. > > $mysql="DELETE FROM table"; > mysql_query($mysql); > > $mssql="SELECT * FROM table"; > $msres=mssql_query($mssql); > while($row=mssql_fetch_row($msres)) { > $mysql="INSERT INTO table VALUES('{$row[0]}','{$row[1]}',...)"; > mysql_query($mysql); > } > > I do suggest you would make the following changes to the code: > > 1. Make a backup of the table in mysql before you delete all rows from it. > 2. In the php code, make error checks and return both query and error, if > there would be some kind of error > > > -- > > //Aho Thanks Aho, sure i try and i say you. Sorry but i post in the Italian php newsgroup and no anyone reply me. So i decide try in a MySql group. Thanks for now. Mauro. |
| ||||
| > I think this may have been better asked at alt.php.sql. > > $mysql="DELETE FROM table"; > mysql_query($mysql); > > $mssql="SELECT * FROM table"; > $msres=mssql_query($mssql); > while($row=mssql_fetch_row($msres)) { > $mysql="INSERT INTO table VALUES('{$row[0]}','{$row[1]}',...)"; > mysql_query($mysql); > > } > > I do suggest you would make the following changes to the code: > > 1. Make a backup of the table in mysql before you delete all rows from it. > 2. In the php code, make error checks and return both query and error, if > there would be some kind of error > > -- > > //Aho It Works. Thanks Aho. Bye. |