ronan.healy (10/15/2012)
update acrtset dbo.ACRT.MIDIRB = dbo.IRBT.IRBRATING
from acrt,IRBT
where dbo.IRBT.id = dbo.IRBT.id +1
and NEGWATCH = 1
It won't update any rows because dbo.IRBT.id will never equal dbo.IRBT.id +1.
Write it as a SELECT first, so that it returns the correct ACRT rows to update with the correct values from IRBT. It's easy to check and simple to convert into an UPDATE.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]