IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[usefun_11_demofor_biz_ext_sql2]') AND type = 'P')
DROP PROCEDURE [dbo].[usefun_11_demofor_biz_ext_sql2]
GO

 create procedure usefun_11_demofor_biz_ext_sql2 (
    @cmpid int 
    ,@branchid int 
    ,@userdpid int 
    ,@useruid int 
    ,@userotid int 
    ,@usersecurity int 
    ,@myid int    ,@code varchar(10)  )
  as 
 BEGIN 
  Declare @jbid bigint,@objid__ bigint,@parseid__ int,@sys_sql_isUpBizExisted__ int,@gotogen__ int,@revertTables__ nvarchar(4000)
  ,@hasUpDS__ int,@curbizid__ int,@curordid__ bigint,@curord2id__ bigint,@curbiztype__ nvarchar(20),@curtagid__ int
  ,@lrevertTable__ nvarchar(100),@i__ int,@cnt__ int
 set @jbid=0 
-- 上级业务类型存在标志--
  select @sys_sql_isUpBizExisted__=0,@hasUpDS__=0,@gotogen__=0,@revertTables__='' --缺省：上级业务类型不存在 
 set @parseid__=445-- 保留变量
-- parseid : 445--

-- parseid : 446--

 select * from mps_employee where cu_code like '%' + @code + '%' and @myid = @myid  
 
  --回滚表 
  if (@revertTables__ is not null) 
    insert into sys_sql_revtables(jobid,tbname) values(@jbid,@revertTables__)
 -- 正常运行结束 -- 
  lblEnd:

END