Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

MSSQL to MySQL via perl

by dannoura (Pilgrim)
on May 12, 2009 at 13:47 UTC ( #763479=perlquestion: print w/ replies, xml ) Need Help??
dannoura has asked for the wisdom of the Perl Monks concerning the following question:

hi,

I'm trying to import data from a MSSQL database to a MySQL database. It seems that some characters get mangled in the translation. When I print them out they come out as a question mark (they also appear that way in the MySQL DB). Basically, I just select from the MSSQL table and then go over the results with fetchrow_array and insert each row (using placeholders) into the MySQL table.

I saw a number of nodes referencing inserts into MSSQL, but none saying anything useful about selects. Anyone have any suggestions?

Comment on MSSQL to MySQL via perl
Download Code
Re: MSSQL to MySQL via perl
by jfroebe (Vicar) on May 12, 2009 at 14:02 UTC

    Hi there,

    Microsoft SQL Server and Sybase ASE/IQ/SQL Anywhere will replace unknown characters with a question mark when the default character set does not match the character set of the data being imported.

    Recommendation: extract the data out of you MySQL database in a delimited file (csv) using the utf8 (unicode) character set. Import into SQL Server using bcp specifying utf8 with "-Jutf8" parameter and character mode "-c".

    Jason L. Froebe

    Blog, Tech Blog

      It appears the OP wants to go MSSQL --> MySQL, not the other way round.

        Somehow I missed that :( The same rules apply: extract out and in with the same character set.

        Jason L. Froebe

        Blog, Tech Blog

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://763479]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-04-18 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (460 votes), past polls