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

-- =============================================
-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[mps_save_prdctgbrowse]
-- Add the parameters for the stored procedure here
@cmpid int,
@pc_id int,
@pc_querytime int,
@pc_groupfields nvarchar(200)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

    -- Insert statements for procedure here
UPDATE mps_prdctg SET
pc_querytime = CASE WHEN @pc_querytime = -999999999 THEN pc_querytime ELSE @pc_querytime END,
pc_groupfields = CASE WHEN @pc_groupfields = '_none_' THEN pc_groupfields ELSE @pc_groupfields END
WHERE pc_id = @pc_id
SELECT 0 NONE WHERE 0=1
END