IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_calc_work_time_1]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_calc_work_time_1]
GO
CREATE  procedure mps_calc_work_time_1as begin -- 本程序只能2分名运行一次 declare @t0 datetime set @t0 = '2018-12-02' declare @t3 datetime set @t3 = '2018-12-01 23:59:59' declare @t4 datetime set @t4 = '2018-12-01 23:59:59'declare @t5 datetime set @t5 = '2018-12-01 23:59:59'declare @t6 datetime set @t6 = '2018-12-01 23:59:59'declare @n datetime set @n=getdate() if (@n>=@t0) begin-- 重新生成本程序exec mps_gen_calc_worktime 1 end elseif ((0=1) and ((@n>=@t3 and @n<=@t4) or (@n>=@t5 and @n<=@t6)))  beginupdate mps_job set jb_elapsedtime =  jb_elapsedtime + 2 where jb_cmpid=1 and jb_limitedtime>0 and jb_confirm=0 and jb_wsid=0 and jb_isauto=1 and jb_back=1 and jb_enabled=0 end end