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

 

posted on 2009-11-27 18:02  sweting  阅读(189)  评论(0编辑  收藏  举报