Tuesday, 27 August 2013

Update Statements in Stored Procedure Suquentially?

Update Statements in Stored Procedure Suquentially?

Below UPDATE A iam updating facot Sqares table
UPDATE A
SET
A.Factor=B.Candy/B.Randy,A.Candy=B.Candy,A.LastModified=sysDatetime(),A.LastModifiedBy=suser_name()
FROM Squares A
INNER JOIN Rects B
on A.YEAR=B.YEAR
AND A.Month=B.month
--iam using updatd factor from the sqare table to calulate final value in
Parameter
UPDATE C
SET C.FinalValue=(C.Cost*A.Factor)
from Parameter C
INNER JOIN Squares A
ON C.YEAR=A.YEAR
AND C.Month=A.Month
So my problem is execution was soing sucesfullu but final value is not
updating in parameter table.

No comments:

Post a Comment