User697462465 posted
Hi raj1947,
According to your description, my understanding is that you would like to use cursor to update each record data, if so please to refer to the following code:
declare c_cursor cursor--declare your cursor
for select id from Student
declare @id int
open c_cursor
fetch next from c_curosr into @id --fetch your first record value
while(@@FETCH_STATUS=0)
begin
update Student
set name = 'hi'
where id=@id
fetch next from c_curosr into @id
end
close c_cursor--close your cursor
deallocate c_cursor--deallocate your cursor
If you have any question please let me know.
Best Regards,
Terry Guo