How to convert binary or hexa to decimal?

A

Adam

Hello,

I'm trying to decifer the data in the table that stores the data in the
binary format. All numbers are placed in varbinary fields. All I know is the
MS SQL 2000 database useing collation SQL_Latin1_General_CP1_CI_AS
(default).

For example the content of the field is:
(0xB4F5000000000000) in unicode and defined as varbinary(8).

Are there any procedures that convert the unicode binary (or hexa) numbers
back to ascii or readable form?

I tried as following but it didn't work.
select cast(0xB4F5000000000000 as decimal(8,2))

Any help is appreciated,
Adam
 
T

Tom Shelton

Hello,

I'm trying to decifer the data in the table that stores the data in the
binary format. All numbers are placed in varbinary fields. All I know is the
MS SQL 2000 database useing collation SQL_Latin1_General_CP1_CI_AS
(default).

For example the content of the field is:
(0xB4F5000000000000) in unicode and defined as varbinary(8).

Are there any procedures that convert the unicode binary (or hexa) numbers
back to ascii or readable form?

I tried as following but it didn't work.
select cast(0xB4F5000000000000 as decimal(8,2))

Any help is appreciated,
Adam

I'm not sure if this helps or not... But, System.Convert can convert
from strings in different bases to a value...

Console.WriteLine(Convert.ToInt64("0xB4F5000000000000", 16))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top