DECLARE
	@SST_Title NVARCHAR (64)='UpdatePatchNumber',
	@SST_Value NVARCHAR (500)='14041021'

    
	-----------------------------------------
	SET @SST_Title = LTRIM(RTRIM(@SST_Title))
	SET @SST_Value = LTRIM(RTRIM(@SST_Value))
	-----------------------------------------
	IF EXISTS (SELECT * FROM [Common].[SystemSetting] WHERE ( SST_Title = @SST_Title ) ) 
	BEGIN
		UPDATE [Common].[SystemSetting] SET
			   SST_Value=@SST_Value
		WHERE                        
			   SST_Title=@SST_Title
	END
	ELSE
	BEGIN
		INSERT INTO [Common].[SystemSetting] ( SST_Title , SST_Value, SST_UserID)
		VALUES (@SST_Title,@SST_Value,1000000000)
		
		INSERT INTO [Common].[SystemSetting] ( SST_Title , SST_Value, SST_UserID)
		VALUES (@SST_Title,@SST_Value,0)
	END	
	

