IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_new_weixin_app]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_new_weixin_app]
GO
CREATE procedure [dbo].[mps_new_weixin_app]  
@wx_id int,  
@wx_title varchar(100),  
@wx_appid int  
AS  
BEGIN  
  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
 declare @wx_cmpid int  
 declare @wx_code varchar(32)  
 declare @wx_appsecret varchar(64)  
 declare @wx_type varchar(10)  
 declare @wx_token varchar(64)  
 declare @wx_aeskey varchar(64)  
  
 select @wx_cmpid=wx_cmpid,  
     @wx_code=wx_code,  
     @wx_type=wx_type  
 from ebs_kernel.dbo.pub_weixin  
 where wx_id=@wx_id  
 -- SET NOCOUNT ON added to prevent extra result sets from  
 -- interfering with SELECT statements.  
 SET NOCOUNT ON;  
 insert into ebs_kernel.dbo.pub_weixin(wx_cmpid,wx_code,wx_type,wx_title,wx_appid)  
 values(@wx_cmpid,@wx_code,@wx_type,@wx_title,@wx_appid);  
  
 select wx_id,wx_title from ebs_kernel.dbo.pub_weixin   
 where wx_id=@@IDENTITY  
END