Log in  ::  Register  ::  Not logged in

 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 08, 2011 8:04 PM
 SSC Rookie Group: General Forum Members Last Login: Yesterday @ 3:10 AM Points: 31, Visits: 272
 Comments posted to this topic are about the item Convert string Hex to Numeric with inline TSQL
Post #1202594
 Posted Wednesday, August 08, 2012 8:11 AM
 SSC Rookie Group: General Forum Members Last Login: Yesterday @ 3:10 AM Points: 31, Visits: 272
 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: Yesterday @ 3:10 AM Points: 31, Visits: 272
 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
 SSCrazy Group: General Forum Members Last Login: Today @ 2:46 AM Points: 2,230, Visits: 2,124
 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

 Permissions

 Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.