﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by fediori  / Convert string Hex to Numeric with inline TSQL / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 19:41:24 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Convert string Hex to Numeric with inline TSQL</title><link>http://www.sqlservercentral.com/Forums/Topic1202594-2632-1.aspx</link><description>[quote][b]Federico Iori (8/8/2012)[/b][hr]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 [/quote]the faster and faster:select CONVERT(VARBINARY, 'fffe', 2)+0 --implicit cast</description><pubDate>Fri, 18 Jan 2013 04:09:11 GMT</pubDate><dc:creator>Carlo Romagnano</dc:creator></item><item><title>RE: Convert string Hex to Numeric with inline TSQL</title><link>http://www.sqlservercentral.com/Forums/Topic1202594-2632-1.aspx</link><description>To convert fast from INT to HEX :  right(master.dbo.fn_varbintohexstr(cast( Disconnection_cause as INT) ),2)</description><pubDate>Mon, 17 Dec 2012 07:08:07 GMT</pubDate><dc:creator>Federico Iori</dc:creator></item><item><title>RE: Convert string Hex to Numeric with inline TSQL</title><link>http://www.sqlservercentral.com/Forums/Topic1202594-2632-1.aspx</link><description>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 </description><pubDate>Wed, 08 Aug 2012 08:11:38 GMT</pubDate><dc:creator>Federico Iori</dc:creator></item><item><title>Convert string Hex to Numeric with inline TSQL</title><link>http://www.sqlservercentral.com/Forums/Topic1202594-2632-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Hexadecimal+conversion+numeric+inline+fast/76413/"&gt;Convert string Hex to Numeric with inline TSQL&lt;/A&gt;[/B]</description><pubDate>Tue, 08 Nov 2011 20:04:46 GMT</pubDate><dc:creator>Federico Iori</dc:creator></item></channel></rss>