MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Conversion problem with cast function
Posted by: Dmitry Tolpeko
Date: December 04, 2012 03:57AM

Hi Alberto,

You are right, MySQL converts 258 to 323528 byte sequence before inserting into a BINARY column.

Can you change your application to insert a hex literal instead of integer value to solve this problem? By the way hex literals are allowed in both SQL Server and MySQL.

MySQL:

  INSERT INTO tresult VALUES (0x00000102);

You can check that this binary value (bytes 00, 00, 01, 02) was inserted using HEX function:

 SELECT HEX(info) FROM tresult;

+-----------+
| HEX(info) |
+-----------+
| 00000102 |
+-----------+

Thanks,

Dmitry Tolpeko

--
SQLines - SQL Server to MySQL Database Migration Tools
http://www.sqlines.com

Options: ReplyQuote


Subject
Written By
Posted
Re: Conversion problem with cast function
December 04, 2012 03:57AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.