﻿SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF OBJECT_ID('[dbo].[sp_UpdateErtesitesiDatum]') IS NOT NULL 
BEGIN
	DROP PROCEDURE [dbo].[sp_UpdateErtesitesiDatum]
END
GO

CREATE PROCEDURE [dbo].[sp_UpdateErtesitesiDatum]
	-- Add the parameters for the stored procedure here
	 @pUserId	INT
	,@pNebuloId	INT
AS
BEGIN

	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;	

	DECLARE @currentDateTime DATETIME 
	SET @currentDateTime = (SELECT GETDATE())

	BEGIN
		UPDATE 
			T_NEBULO
		SET 
			C_ERTESITESDATUMA =					@currentDateTime
			
            ,C_IMPORTALT =						'F'
			,SERIAL =							SERIAL + 1
			,LASTCHANGED =						@currentDateTime
			,MODIFIER =							@pUserId
		WHERE
			ID = @pNebuloId
	END

END

GO

