IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_allow_time]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_allow_time]
GO
CREATE procedure [dbo].[mps_g_allow_time] 
@objtype varchar(10),
@objid int 
as
begin
set nocount on
select * from mps_allow_time where wt_type=@objtype and wt_objid=@objid 
select * from mps_extsqljs where cd_objid=@objid and cd_objid2=0 and cd_name=@objtype+'.time' 
set nocount off
end