04-30-2015 12:29 PM
I m using below query
L9RM_C=L9_C - calculated L9BE_C;
This is throwing an ERROR: The illegal use of a CALCULATED variable has been detected in an UPDATE statement.
04-30-2015 01:30 PM
Sorry, I am not getting your questions
L_* are columns of the table Work.Sim_re_BERM.
Setting L9BE_C based on calculation max(0,L9_C*(L9BE/L9))
And L9RM_C based difference between L9_C on CALCUALTED L9BE_C.
04-30-2015 02:08 PM
OK, maybe I get it now. Have you tried getting rid of CALCULATED :
L9BE_C = max(0, L9_C*(L9BE/L9)),
L9RM_C = L9_C - max(0, L9_C*(L9BE/L9));
04-30-2015 02:59 PM
SQL is a formal language with very strict syntax. That is very different from natural languages which are much more flexible but also more prone to misinterpretation. I think the UPDATE query is made such that every assignment (L9BE_C =, L9RM_C =, etc) clause can be treated separately (and thus, in parallel).