test cursor:
use huirui
go
declare @id int,@a varchar(50)
declare mycursor cursor for select m_id from message
open mycursor
fetch next from mycursor into @id
while(@@fetch_status=0)
begin
update message set m_isread=1 where m_id=@id
fetch next from mycursor into @id
end
close mycursor
deallocate mycursor