IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[finishedtask]') AND type = 'P')
DROP PROCEDURE [dbo].[finishedtask]
GO
-- 返回 0 表示可以用，返回1表示上一次还没有结束
create procedure [dbo].[finishedtask](
@tmid int 
) as
begin
update mps_timer_control with(rowlock) set tm_status=1  where tm_name=@tmid and tm_status=0 
end