January 24, 2008 at 1:36 pm
Declare
@i BigInt,
@Hex VarChar(256),
@Str nVarChar(4000)
Select
@Hex='000000000010', -- String of Hex characters to be converted
@Str='Set @i=Cast(0x'+@Hex+' as BigInt)'
Exec sp_ExecuteSQL @Str,N'@i BigInt Output',@i Output
Print '0x'+@Hex+' = '+Cast(@i as VarChar)
-- Change BigInt to Int depending on your requirements.
January 24, 2008 at 5:53 pm
Do you have a question?
January 24, 2008 at 8:28 pm
Looks like a nice tip... probably meant to post this under "scripts".
Thanks, Pete.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 25, 2008 at 8:07 am
No question, just ran across this issue while researching another topic, thougth I'd drop my 2 cents worth for the forum...
I'll use Scripts next time.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy