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] 
@cmpid int,
@objtype varchar(10),
@objid int 
as
begin
set nocount on
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
select * from mps_allow_time with(nolock)  where wt_cmpid=@cmpid and  wt_type=@objtype and wt_objid=@objid 
select * from mps_extsqljs with(nolock)  where cd_objid=@objid and cd_objid2=0 and cd_name=@objtype+'.time' 
set nocount off
end