IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_g_extsqljs]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_g_extsqljs]
GO
CREATE procedure [dbo].[mps_g_extsqljs]   
@objid int ,   
@objid2 int ,  
@cdnames varchar(500)   
 as  
begin  
 set nocount on   
 declare @s varchar(500)   
 declare @s1 varchar(100)   
 declare @i int   
 set @s = @cdnames   
 declare @t table(cdname varchar(50))   
 while (@s>'')   
 begin  
  set @i = charindex(',',@s)   
  if (@i>0)   
  begin  
   set @s1 = substring(@s,1,@i-1)   
   set @s = substring(@s,@i+1,len(@s)-@i)   
  end else   
  begin  
   set @s1 = @s   
   set @s = ''   
  end   
  if (@s1>'')   
  begin  
   insert into @t(cdname) values(@s1)   
  end   
 end   
 select * from mps_extsqljs ,  @t   
 where cd_objid=@objid and cd_objid2=@objid2 and cd_name=cdname 
 --添加标识，快速定位是否存在开发配置代码
 select cd_id,cd_name from mps_extsqljs    
 where cd_objid=@objid and cd_objid2=@objid2 and datalength(cd_text)>0 
 
   
 set nocount off   
end