I
I
Ivan2016-07-14 12:43:16
MySQL
Ivan, 2016-07-14 12:43:16

How to overcome encoding?

Good afternoon. There is a database on mysql, I upload data from it to mssql. One of the fields with the client card code is stored in this form

0x187B943300000000

I need to cut off 0x18 and trailing zeros. REPLACE and conversion doesn't work. The field has a data type of varbinary and therefore results in Japanese characters or character sets. This will be done mysql or mssql without a difference.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2016-07-14
@habrakot

MSSQL
Select Left(Right(master.dbo.fn_varbintohexstr(cast(0x187B943300000000 as varbinary)),14),6)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question