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

-- =============================================
-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[mps_save_extresbrowse]
-- Add the parameters for the stored procedure here
@cmpid int,
@etc_id int,
@etc_querytime int,
@etc_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_ext_resource SET
etc_querytime = CASE WHEN @etc_querytime = -999999999 THEN etc_querytime ELSE @etc_querytime END,
etc_groupfields = CASE WHEN @etc_groupfields = '_none_' THEN etc_groupfields ELSE @etc_groupfields END
WHERE etc_id = @etc_id
SELECT 0 NONE WHERE 0=1
END