<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Converting from hex string to varbinary and vice versa</title><link>http://blogs.msdn.com/sqltips/archive/2008/07/02/converting-from-hex-string-to-varbinary-and-vice-versa.aspx</link><description>Converting hexadecimal values to varbinary and vice versa is now easier using the XQuery functionality available from SQL Server 2005. The code samples below show how to perform the conversion(s): -- Convert hexstring value in a variable to varbinary:</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>a-foton &amp;raquo; Converting from hex string to varbinary and vice versa</title><link>http://blogs.msdn.com/sqltips/archive/2008/07/02/converting-from-hex-string-to-varbinary-and-vice-versa.aspx#8682564</link><pubDate>Thu, 03 Jul 2008 04:39:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8682564</guid><dc:creator>a-foton &amp;raquo; Converting from hex string to varbinary and vice versa</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.a-foton.ru/2008/07/converting-from-hex-string-to-varbinary-and-vice-versa/"&gt;http://blog.a-foton.ru/2008/07/converting-from-hex-string-to-varbinary-and-vice-versa/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Problem with data being converted to ASCII character representations</title><link>http://blogs.msdn.com/sqltips/archive/2008/07/02/converting-from-hex-string-to-varbinary-and-vice-versa.aspx#9105151</link><pubDate>Mon, 17 Nov 2008 04:27:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9105151</guid><dc:creator>SamCPP</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am running SQL Server 2008 Enterprise Evaluation with Cumulative Update 1 installed. When I process your sample in Query Analyzer, my results for the select queries are:&lt;/p&gt;
&lt;p&gt;0x3078616263656466303132343339&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;0x616263656466303132343339&lt;/p&gt;
&lt;p&gt;so it has converted the characters to the binary representation of the ASCII rather than what I expected:&lt;/p&gt;
&lt;p&gt;0xABCEDF012439&lt;/p&gt;
&lt;p&gt;Is there a flaw with CONVERT now? Or is that expected behaviour?&lt;/p&gt;
</description></item><item><title>re: Converting from hex string to varbinary and vice versa</title><link>http://blogs.msdn.com/sqltips/archive/2008/07/02/converting-from-hex-string-to-varbinary-and-vice-versa.aspx#9105921</link><pubDate>Mon, 17 Nov 2008 06:17:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9105921</guid><dc:creator>SamCPP</dc:creator><description>&lt;p&gt;Sorry I was connected from a SSMS 2k8 to a SQL Server 2005 server.&lt;/p&gt;
</description></item></channel></rss>