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,132 of 19,505   
   Erland Sommarskog to Lennart Jonsson   
   Re: CASE issue   
   24 Nov 14 23:37:12   
   
   From: esquel@sommarskog.se   
      
   Lennart Jonsson (erik.lennart.jonsson@gmail.com) writes:   
   > I think (don't have time to look it up now) the SQL-standard says that   
   > the result of the CASE statement is the first condition that evaluates   
   > to true. From your answer I get the impression that this is not true for   
   > SQL-server, correct?   
      
   That is indeed true. The issue is that the expression on the left-hand side   
   is reevaluated for every branch in the CASE.   
      
   newid() is a function that returns a randomly generated GUID, so it is a bit   
   of a special case.   
      
      
      
      
   --   
   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