IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_up_login_set]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_up_login_set]
GO
CREATE procedure [dbo].[mps_up_login_set]
@cmpid int,
@cmp_login_bg varchar(255),
@cmp_login_title nvarchar(255),
@cmp_login_model int,
@cmp_login_picture varchar(255)
AS
BEGIN
update ebs_kernel.dbo.pub_company set
cmp_login_bg=case when @cmp_login_bg='_none_'       then cmp_login_bg       else @cmp_login_bg end,
cmp_login_title=case when @cmp_login_title='_none_'    then cmp_login_title    else @cmp_login_title end,
cmp_login_picture=case when @cmp_login_picture='_none_'  then cmp_login_picture  else @cmp_login_picture end,
cmp_login_model=case when @cmp_login_model=-999999999    then cmp_login_model       else @cmp_login_model end 
where cmp_id=@cmpid
END