IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_up_pcmenu_set]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_up_pcmenu_set]
GO
CREATE procedure [dbo].[mps_up_pcmenu_set]
@cmpid int,
@mn_title varchar(255),
@mn_link nvarchar(255),
@mn_order int,
@mn_icon varchar(255),
@mn_sub int,
@mn_id bigint
AS
BEGIN
update mps_menu set
mn_title=case when @mn_title='_none_'       then mn_title       else @mn_title end,
mn_link=case when @mn_link='_none_'    then mn_link    else @mn_link end,
mn_icon=case when @mn_icon='_none_'  then mn_icon  else @mn_icon end,
mn_order=case when @mn_order=-999999999    then mn_order       else @mn_order end, 
mn_sub=case when @mn_sub=-999999999    then mn_sub       else @mn_sub end 
where mn_cmpid=@cmpid and mn_id = @mn_id
END