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 17,575 of 19,505   
   Plamen Ratchev to All   
   Re: CASE Statement in WHERE EXISISTS Cla   
   18 Jul 09 16:10:52   
   
   2b2be994   
   From: Plamen@SQLStudio.com   
      
   You need to repeat the whole CTE definition within the IF and the ELSE   
   sections:   
      
   IF ....   
   WITH ...   
   SELECT....   
   WHERE ...   
      
   ELSE   
   WITH ...   
   SELECT....   
   WHERE ...   
      
   The CTE definition cannot be separated by the SELECT/INSERT/DELE   
   E/UPDATE/MERGE statement that is using it, it is part   
   of the same query.   
      
   --   
   Plamen Ratchev   
   http://www.SQLStudio.com   
      
   --- 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