Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Data Warehousing / May 2005

Tip: Looking for answers? Try searching our database.

How to convert binary or hexa to decimal?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adam - 11 May 2005 15:57 GMT
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
Adam Machanic - 12 May 2005 17:50 GMT
Hi,

There is no such thing as "unicode binary".  Unicode is a character encoding
format.  Binary is enencoded ("raw", if you will.)

What format was the data before you converted it to binary?  Is it a decimal
number?  Or is it some characters?  Or..?

Signature

Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--

> Hello,
>
[quoted text clipped - 14 lines]
> Any help is appreciated,
> Adam
Michelle Campbell - 22 May 2005 23:49 GMT
I always use convert(int,0xB4F5000000000000) to convert my varbinary
columns. As far as I know they never have decimal places so int is just
fine.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.