Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1767

Varbinary and nvarchar problem

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 <sheldonlg@thevillages.net>
Newsgroups comp.databases.ms-sqlserver
Subject Varbinary and nvarchar problem
Date Thu, 19 Jun 2014 15:00:26 -0400
Organization A noiseless patient Spider
Lines 23
Message-ID <lnvbvt$ck3$1@dont-email.me> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Thu, 19 Jun 2014 19:00:13 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="8ee873ed26843422d6d6b2a910ee355c"; logging-data="12931"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Z/f3599O2iv8nqd1Vqbk8/yFne/66094="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
Cancel-Lock sha1:IV5iVWeEVkjC1BmviTDGoS0pajg=
Xref csiph.com comp.databases.ms-sqlserver:1767

Show key headers only | View raw


I have a table with a field that is nvarchar.  The input data is 
obtained from first doing a HASHBYTES(MD5, the_char_string). Call this 
the_data.

If I first do a CAST(the_data as NVARCHAR)  or if I do a 
CONVERT(NVARCHAR, the_data), then there is no problem with inserting the 
field.  However, when I do a select * via Sqlserver Manager, that field 
contains the string "??????".

If I do not first do the conversion, it insert the hash into the field, 
and succeeds for the first 15 of 1991 records.  It then bombs with 
"incorrect syntax near '<9e>V!¢(Q Ã+;<86>"^@Lmç'.

This process is interrogating a join of two tables and then is inserting 
a processing of the resulting data rows into another table.  It is on 
the insert (which is one condition of a merge statement) where the 
failure occurs.

Does anyone have a suggestion on how I can get the data into the third 
table and not have it all be "???????".

-- 
Shelly

Back to comp.databases.ms-sqlserver | Previous | NextNext in thread | Find similar


Thread

Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-19 15:00 -0400
  Re: Varbinary and nvarchar problem Erland Sommarskog <esquel@sommarskog.se> - 2014-06-19 23:06 +0200
    Re: Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-19 17:49 -0400
      Re: Varbinary and nvarchar problem Erland Sommarskog <esquel@sommarskog.se> - 2014-06-20 16:16 +0200
        Re: Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-21 09:17 -0400
        Re: Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-23 09:49 -0400
          Re: Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-23 10:27 -0400
            Re: Varbinary and nvarchar problem Erland Sommarskog <esquel@sommarskog.se> - 2014-06-23 21:33 +0200
              Re: Varbinary and nvarchar problem Shelly <sheldonlg@thevillages.net> - 2014-06-23 16:35 -0400
                Re: Varbinary and nvarchar problem Erland Sommarskog <esquel@sommarskog.se> - 2014-06-24 07:19 +0000

csiph-web