SQL正常工作日上班安排

alter proc [work]
as
declare @i int
set @i=1
while @i<1000
begin

select top 1 id into #restdate from dt_work where work_date in (select rest_time from dt_rest ) order by id asc

update dt_work set  work_date=CONVERT(varchar(100),dateadd("d",1,CONVERT(varchar(100), work_date, 23)), 23) where  id>=( select id from #restdate )
set @i=@i+1
drop table #restdate
end

 

posted @ 2016-01-07 13:51  请叫我七哥  阅读(304)  评论(0编辑  收藏  举报