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

-- =============================================  
-- Author:  郑华建  
-- Create date: 2018年1月9日 14点06分  
-- Description: 创建新的分享,返回ID  
-- =============================================  
CREATE PROCEDURE [dbo].[mps_new_mobileshare]  
 @url varchar(500)  
AS  
BEGIN  
 SET NOCOUNT ON;  
 declare @shareid int  
 select @shareid = ms_id from mps_mobileshare where ms_url=@url  
 if @shareid is null  
 begin  
  insert into mps_mobileshare(ms_url) values(@url)  
  set @shareid=@@IDENTITY  
 end  
 select @shareid as shareid  
END