Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Convert string Hex to Numeric with inline TSQL Rate Topic Display Mode Topic Options
Author
 Message
 Posted Tuesday, November 8, 2011 8:04 PM
 SSC Rookie Group: General Forum Members Last Login: Thursday, January 7, 2016 4:56 AM Points: 33, Visits: 300
 Comments posted to this topic are about the item Convert string Hex to Numeric with inline TSQL
Post #1202594
 Posted Wednesday, August 8, 2012 8:11 AM
 SSC Rookie Group: General Forum Members Last Login: Thursday, January 7, 2016 4:56 AM Points: 33, Visits: 300
 A faster way to convert Hex to Dec is select CAST(CONVERT(VARBINARY, 'FF00FF', 2) AS INT)The string to convert must be at least 2 chars long : select CAST(CONVERT(VARBINARY, 'F', 2) AS INT) : errorselect CAST(CONVERT(VARBINARY, '0F', 2) AS INT) : 15
Post #1341895
 Posted Monday, December 17, 2012 7:08 AM
 SSC Rookie Group: General Forum Members Last Login: Thursday, January 7, 2016 4:56 AM Points: 33, Visits: 300
 To convert fast from INT to HEX : right(master.dbo.fn_varbintohexstr(cast( Disconnection_cause as INT) ),2)
Post #1397249
 Posted Friday, January 18, 2013 4:09 AM
 Hall of Fame Group: General Forum Members Last Login: Monday, November 28, 2016 1:13 AM Points: 3,367, Visits: 3,190
 Federico Iori (8/8/2012)A faster way to convert Hex to Dec is select CAST(CONVERT(VARBINARY, 'FF00FF', 2) AS INT)The string to convert must be at least 2 chars long : select CAST(CONVERT(VARBINARY, 'F', 2) AS INT) : errorselect CAST(CONVERT(VARBINARY, '0F', 2) AS INT) : 15 the faster and faster:select CONVERT(VARBINARY, 'fffe', 2)+0 --implicit cast
Post #1408809
 Posted Monday, May 2, 2016 4:20 PM
 SSCrazy Eights Group: General Forum Members Last Login: Yesterday @ 7:11 AM Points: 8,298, Visits: 852
 Thanks for the script.
Post #1782753

 Permissions