bruce wrote:
> On Feb 29, 10:31 am, "Peter H. Coffin" <hell...@ninehells.com> wrote:
>> On Fri, 29 Feb 2008 06:38:56 -0800 (PST), bruce wrote:
>>> MySql newbie, sorry if the question is elementary. I'm trying to
>>> convert sql server database to MySql. Wrote a simple program to read
>>> the MS SQL Server tables, and write to corresponding MySql tables.
>>> Everything is going fine with one exception: the Insert statement
>>> to write to the MySql table doesn't work when I encounter an Ascii
>>> 146.
>>> Don't know much about character sets, but when creating the table,
>>> I used the default character set, which is Latin1, I believe. I
>>> thought that would handle non-Ascii characters.
>>> Why does the insert statement fail? Thanks for any help given.
>> As a differnt question, why reinvent the wheel? There are several
>> conversion tools listed about half-way down on
>>
>> http://dev.mysql.com/tech-resources/...from-microsoft...
>>
>> which may save you time and hassle. The rest of the page is a worthwhile
>> reaqd as well, since it will probably answer the next dozen or so
>> questions you'll have about how things work differently.
>>
>> --
>> People who are willing to rely on the government to keep them safe are
>> pretty much standing on Darwin's mat, pounding on the door, screaming,
>> 'Take me, take me!'
>> -- Carl Jacobs in the Monastery
>
> Thank for directing me there. It's a helpful document for me to have
> in other areas of my migration, though it didn't shed light on this
> exact question. I'll have to conclude that MySql, unlike SQL Server,
> is treating an Ascii 146 like a single quote (which it looks like),
> thereby giving me the SQL syntax error on the insert. I'll get around
> it in the program I'm developing to do the migration. Thanks for your
> help.
from:
http://dev.mysql.com/doc/refman/5.0/...ng-syntax.html
Within a string, certain sequences have special meaning. Each of these
sequences begins with a backslash (“\”), known as the escape character.
MySQL recognizes the following escape sequences:
\0 An ASCII 0 (NUL) character.
\' A single quote (“'”) character.
\" A double quote (“"”) character.
\b A backspace character.
\n A newline (linefeed) character.
\r A carriage return character.
\t A tab character.
\Z ASCII 26 (Control-Z). See note following the table.
\\ A backslash (“\”) character.
\% A “%” character. See note following the table.
\_ A “_” character. See note following the table.