I am facing a strange issue which I have never faced before. I have a update query like below
Update A
Set A.Col10 = E.Col10, A.Col11 = E.Col11
FROM TableA A
INNER JOIN TableB B on A.Col1 = B.Col1
INNER JOIN TableC C on C.Col1 = B.Col2
INNER JOIN TableD D on D.Col1 = C.Col2
INNER JOIN TableE E on E.Col1 = D.Col2
WHERE D.Col3 BETWEEN @StartDate AND @ENDDate
AND E.Col10 <> A.Col10
When i am running above statement it is giving message that 810 rows are updated. but when I am selecting based on the same criteria I am still getting those 810 rows.
SELECT A.Col10 , E.Col10
FROM TableA A
INNER JOIN TableB B on A.Col1 = B.Col1
INNER JOIN TableC C on C.Col1 = B.Col2
INNER JOIN TableD D on D.Col1 = C.Col2
INNER JOIN TableE E on E.Col1 = D.Col2
WHERE D.Col3 BETWEEN @StartDate AND @ENDDate
AND E.Col10 <> A.Col10
no matter how many times I update the table it is still showing the same count. now, my question is where I am going wrong and what are those records which got updated when actually no records are updated.