Last post Aug 12, 2013 06:03 AM by Terry Guo - MSFT
Aug 10, 2013 06:19 AM|raj1947|LINK
I need to manipulate the row in field by using cursor.(supose 250 record means i need to change the particular field in each row)
Aug 12, 2013 06:03 AM|Terry Guo - MSFT|LINK
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
fetch next from c_curosr into @id --fetch your first record value
set name = 'hi'
fetch next from c_curosr into @id
close c_cursor--close your cursor
deallocate c_cursor--deallocate your cursor
If you have any question please let me know.