Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Shelly Newsgroups: comp.databases.ms-sqlserver Subject: Re: Varbinary and nvarchar problem Date: Sat, 21 Jun 2014 09:17:59 -0400 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 21 Jun 2014 13:17:39 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="8ee873ed26843422d6d6b2a910ee355c"; logging-data="11823"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hOCF8ueSlVqK2vUoQPOn/xp9t9gKpucc=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:ybEx7/Hwaa4UqJHGP9ffki0kFzo= Xref: csiph.com comp.databases.ms-sqlserver:1772 On 6/20/2014 10:16 AM, Erland Sommarskog wrote: > Shelly (sheldonlg@thevillages.net) writes: >> Anyway, I have the solution. It is to enclose the HASHBYTES stuff with >> the following: >> >> SUBSTRING(master.dbo.fn_varbintohexstr( hashbytes calculation ), 3, 32). >> >> The result is a 32 character hex string put into the tracking table. >> > > If you are on SQL 2008, use > > convert(varchar(32), hashbytes, 2) > > instead, as this is a documented and supported way to get a hex string. Thanks. I'll try that. -- Shelly