ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【原创】用游标处理calendar的update问题

【原创】用游标处理calendar的update问题

原创 Linux操作系统 作者:jyang57 时间:2010-04-07 14:50:07 0 删除 编辑
select * into #t from calendar declare @ww int, @ww_index int declare #tempp cursor for select ww, ww_index from #t where ww_index>470 open #tempp fetch next from #tempp into @ww, @ww_index while @@fetch_status = 0 begin update #t set ww =2 where ww_index = 1 update #t set ww = 3 where ww_index = 2 update #t set ww= 222 where ww_index = 3 fetch next from #tempp into @ww, @ww_index end close #tempp deallocate #tempp -- select * from #t drop table #t

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23155850/viewspace-631513/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-01-09

  • 博文量
    110
  • 访问量
    164134