PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Copy data from MsSql database to a MySql database in batch mode.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Copy data from MsSql database to a MySql database in batch mode.

Réponse
 
LinkBack Outils de la discussion
Vieux 26/10/2007, 18h00   #1
Mauro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Copy data from MsSql database to a MySql database in batch mode.

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.


  Réponse avec citation
Vieux 26/10/2007, 18h52   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Copy data from MsSql database to a MySql database in batch mode.

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
  Réponse avec citation
Vieux 26/10/2007, 20h01   #3
Mauro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Copy data from MsSql database to a MySql database in batch mode.

> 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.


  Réponse avec citation
Vieux 29/10/2007, 22h31   #4
Mauroreggio@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Copy data from MsSql database to a MySql database in batch mode.

> 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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h53.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12883 seconds with 12 queries