title: Problem with SQL Server 2000 Cursor Not Fetching NEXT
body: <p>I've got a SQL Server 2000 db. I need to run the following cursor to fire a trigger on individual records (the trigger will only operate on one record at a time).</p>
  
  <pre><code>DECLARE @REC as bigint
  
  DECLARE coil1_cursor CURSOR FOR
  SELECT Rec# FROM coil1 WHERE Timestamp BETWEEN '2011-05-10 06:00:00' AND '2011-05-10 07:00:00'
  
  OPEN coil1_cursor
  FETCH NEXT FROM coil1_cursor INTO @REC
  
  WHILE (@@FETCH_STATUS=0)
  BEGIN
      Print @Rec
      UPDATE coil1 SET ShiftLength=Null WHERE Rec#=@REC
  
      FETCH NEXT FROM coil1_cursor INTO @REC
  END
  CLOSE coil1_cursor
  DEALLOCATE coil1_cursor
  </code></pre>
  
  <p>If I comment out the UPDATE line, I get sequential numbers from Rec# field as expected. If I uncomment the UPDATE line, the batch goes into an infinite loop. When I stop the batch, it only shows updating the first record it gets to. It's like the FETCH NEXT gets stuck. Any ideas why?</p>