Conversion of Hex number to decimal format

I need to convert a Hexidecimal number (0107017ee440be56) to a decimal format using SQL.  This has to be done during a loop.  Is there any easy way to do this?
blbergerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh RetnakaranDatabase AdministratorCommented:
SELECT CAST(0x0107017ee440be56 AS BIGINT)  -- prefix a  '0x' and then do a cast
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<SELECT CAST(0x0107017ee440be56 AS BIGINT)  -- prefix a  '0x' and then do a cast>>
Hey that's a cute solution...Thanks...
0
dbbishopCommented:
Racimo: looks like more than one person learned something today. Think you and I can give aneeshattingal some points?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<Racimo: looks like more than one person learned something today. Think you and I can give aneeshattingal some points?>>
I particularly like the elegance of the solution...(simple and easy)

I'd be glad to give some poinks but I am afraid the only way to do that would be to create a fake question and attribute poinks without rela answer.   I am not sure about what EE's guideline say about that...
0
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
In other words..It's good to learn something about SQL once in a blue moon...
0
Aneesh RetnakaranDatabase AdministratorCommented:
>It's good to learn something about SQL once in a blue moon.
as far as I am concerned, from ee, i am learning at least one thing per day, and we are here to help others and learn something new;  I am glad that I helped you guys in this.  :)
0
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<as far as I am concerned, from ee, i am learning at least one thing per day>>
Lucky you...

<<I am glad that I helped you guys in this>>
I particularly like little tricks and this is one of them...I wish I could pay you back with a few I am aware of...

Anyway that's the kind of thread and spirit that make me like EE...
;)
0
dbbishopCommented:
I went from application developer to database developer almost overnight three months ago and if it weren't for EE, I'd have been on the streets 2-1/2 months ago :-)
0
Anthony PerkinsCommented:
As developers we are all missing the requirements:
"This has to be done during a loop."

So here you go:

Declare @Loop integer

Set @Loop = 0
While @Loop < 1000000
    Set @Loop = @Loop + 1

-- Now we can apply Aneesh's solution:
SELECT CAST(0x0107017ee440be56 AS BIGINT)
0
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<offtopic moment of delirium>
<<As developers we are all missing the requirements:>>
Common!!! Antony you are spoiling the fun !!!! LOL...!!!
</<offtopic moment of delirium>>
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.