"Adam" <adam@blah.com> wrote in message
news:7Dpge.32562$B82.820549@news20.bellglobal.com. ..
> 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 I follow your description, but in any event, if you remove the
trailing zeroes, then you can convert to an int:
select cast(0xB4F5 as int)
That could be a valid Unicode character:
http://toni.technetium.be/ascii/unicode.php?nr=180
So if you have the appropriate language support installed in your client,
you may be able to do this:
select nchar(cast(0xB4F5 as int))
See NCHAR() and UNICODE() in Books Online. If this doesn't help, you might
want to clarify what you're looking for, and what you understand the binary
data represents - is every column value a single Unicode character, for
example?
Simon