home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,080 of 19,505   
   Erland Sommarskog to Shelly   
   Re: Varbinary and nvarchar problem   
   23 Jun 14 21:33:35   
   
   From: esquel@sommarskog.se   
      
   Shelly (sheldonlg@thevillages.net) writes:   
   > I also tried converting each piece int the HASHBYTES to a varchar or to   
   > an nvarchar and still got errors in the pieces -- even though the one   
   > without any conversions -- the plain HASHBYTES -- worked. I also tried   
   > CAST, but still had those errors.   
   >   
   > Why does   
   >   
   > CONVERT(VARCHAR(32), something-that-works, 2)   
   >   
   > fail -- and with a conversion to int?   
   >   
      
   Because you use it in expression which also includes an integer value,   
   (which because of the data-type precedence rules in SQL Server leads to an   
   implicit conversion) or you are trying to insert the data into an integer   
   column/variable.   
      
   That is all I can say without seeing the rest of the code and the   
   table definitions. Well, one more thing: watch out for triggers with   
   dynamic SQL.   
      
   --   
   Erland Sommarskog, Stockholm, esquel@sommarskog.se   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca