IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_new_exportapi]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_new_exportapi]
GO
create procedure [dbo].[mps_new_exportapi]   
@cmpid int 
as  
begin  
    set nocount on   
declare @expid bigint
declare @ctime datetime 
set @ctime = getdate()
insert into mps_exportapi
(exp_cmpid,exp_name,exp_sql,exp_language,exp_result,exp_allowip,exp_allowtime,exp_createtime)
values(@cmpid,'','','','','','',@ctime);

select top 1 @expid = exp_id from mps_exportapi
where exp_cmpid = @cmpid and exp_name = '' and 
  exp_sql = '' and exp_language = ''and 
  exp_result= '' and  exp_allowip = '' and exp_allowtime = '' and exp_createtime = @ctime
  
select * 
from  mps_exportapi where exp_id = @expid 

set nocount off  
end