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 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply