title: Windowed functions can only appear in the SELECT or ORDER BY clauses-update in cursor
body: <pre><code>Declare @Customerid int 
  DECLARE ChangeCustomerName CURSOR FOR 
  select customerid from customer 
  OPEN ChangeCustomerName
  FETCH NEXT FROM ChangeCustomerName into @Customerid
  WHILE @@fetch_status = 0
  BEGIN
  
    update customer set customername ='Customer'
      +convert (varchar(10),ROW_NUMBER() OVER(ORDER BY customerid ASC)) 
      where customerid=@Customerid
  
     FETCH NEXT FROM ChangeCustomerName into @Customerid
  END
  close ChangeCustomerName
  deallocate ChangeCustomerName
  </code></pre>
  
  <blockquote>
    <p>Windowed functions can only appear in the SELECT or ORDER BY clauses-update in cursor</p>
  </blockquote>