title: how to solve cursor work only first time in sql server
body: <p>i have declare a cursor in one procedure and make a loop inside it. but when i execute procedure cursor
  occur only first time what happen to this i want it occur everytime when procedure is executed.</p>
  
  <pre><code>DECLARE SUP_CUR CURSOR SCROLL DYNAMIC  FOR SELECT * FROM @saleSup
  DECLARE @SUP_TEMP AS INT
  OPEN SUP_CUR
  WHILE @@FETCH_STATUS =0 
  BEGIN
      FETCH NEXT FROM SUP_CUR INTO @SUP_TEMP
  
      SELECT COUNT (DISTINCT saleRepId),userId   FROM @tabletemp WHERE userId = @SUP_TEMP GROUP BY userId 
  
  END 
  CLOSE SUP_CUR;
  DEALLOCATE SUP_CUR; 
  </code></pre>