Ms Zusammenführung smartup DD_ECM

This commit is contained in:
Developer01
2025-03-28 15:28:32 +01:00
parent beb7850a92
commit a60d5a6f9d
12 changed files with 380 additions and 446 deletions

View File

@@ -1944,36 +1944,37 @@ END
--SELECT [dbo].[FNDD_GET_DECIMAL_FOR_VARCHAR] ('15681444,56')
--GO
GO
-- [FNDD_CONVERT_RTF2Text]
-- [FNDD_CONVERT_RTF2TEXT]
-- =================================================================
-- Converts a RTF text to a regular text
--
-- Returns: NVARCHAR - text
-- =================================================================
-- Copyright (c) 2024 by Digital Data GmbH
-- Copyright (c) 2025 by Digital Data GmbH
--
-- Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
-- Tel.: 0641/202360 • E-Mail: info-flow@digitaldata.works
-- =================================================================
-- Creation Date / Author: 26.09.2024 / HE,MK
-- Version Date / Editor: 14.12.2024 / HE,MK
-- Version Number: 1.1.0.0
-- Version Date / Editor: 25.03.2025 / HE,MK
-- Version Number: 1.2.0.0
-- =================================================================
-- History:
-- 26.09.2024 / HE,MK - First Version
-- 14.12.2024 / MK - code optimisation, new additional parameters
-- 25.03.2025 / HE,MK - Remove rtf format strings
CREATE OR ALTER FUNCTION [dbo].[FNDD_CONVERT_RTF2Text](
CREATE OR ALTER FUNCTION [dbo].[FNDD_CONVERT_RTF2TEXT](
@pRTF nvarchar(max), -- Give the RTF text, you want to convert
@pREMOVE_LINE_WRAP BIT = 1, -- Set to 1 to remove line wraps
@pREMOVE_DOUBLE_BLANKS BIT = 1 -- Set to 1 to remove unnecessary blanks
@pREMOVE_LINE_WRAP BIT = NULL, -- Set to 1 to remove line wraps
@pREMOVE_DOUBLE_BLANKS BIT = NULL -- Set to 1 to remove unnecessary blanks
)
RETURNS nvarchar(max)
AS
BEGIN
-- decalare new vars because of parameter sniffing
DECLARE @RTF NVARCHAR(256) = ISNULL(@pRTF,''),
DECLARE @RTF NVARCHAR(max) = ISNULL(@pRTF,''),
@REMOVE_LINE_WRAP BIT = ISNULL(@pREMOVE_LINE_WRAP,1),
@REMOVE_DOUBLE_BLANKS BIT = ISNULL(@pREMOVE_DOUBLE_BLANKS,1);
@@ -2080,6 +2081,9 @@ BEGIN
-- Anyway remove trailing spaces
SET @rtf = LTRIM(RTRIM(@rtf));
-- Replace rtf format strings
SET @rtf = Replace(@rtf,'Riched20 10.0.17763} ','');
END;
RETURN @rtf;
@@ -5036,6 +5040,40 @@ BEGIN
END
GO
-- [VWEMLP_EMAIL_DATA]
-- =================================================================
-- Joins email tables for indexing service
--
-- Returns: table
-- =================================================================
-- Copyright (c) 2025 by Digital Data GmbH
--
-- Digital Data GmbH • Ludwig-Rinn-Strasse 16 • D-35452 Heuchelheim
-- Tel.: 0641/202360 • E-Mail: info-flow@digitaldata.works
-- =================================================================
-- Creation Date / Author: 19.03.2025 / HE,MK
-- Version Date / Editor: 25.03.2025 / MK
-- Version Number: 1.1.0.0
-- =================================================================
-- History:
-- 19.03.2025 / HE,MK - First Version
-- 25.03.2025 / MK - Added Attachment count
CREATE OR ALTER VIEW [dbo].[VWEMLP_EMAIL_DATA]
as
SELECT TOP 100 PERCENT
[TBEMLP_HISTORY].[EMAIL_MSGID],
[TBEMLP_HISTORY].[EMAIL_FROM],
[TBDD_EMAIL_ACCOUNT].[EMAIL_FROM] as [EMAIL_TO],
[TBEMLP_HISTORY].[EMAIL_SUBJECT],
[TBEMLP_HISTORY].[EMAIL_DATE],
[TBEMLP_HISTORY].[EMAIL_BODY],
ISNULL((SELECT count(*) FROM [TBEMLP_HISTORY_ATTACHMENT] (NOLOCK) WHERE [TBEMLP_HISTORY].[EMAIL_MSGID] = [TBEMLP_HISTORY_ATTACHMENT].[EMAIL_MSGID]),0) as 'EMAIL_ATTACHMENT_COUNT'
FROM [TBEMLP_HISTORY] (NOLOCK)
INNER JOIN [TBEMLP_POLL_PROFILES] (NOLOCK) ON [TBEMLP_HISTORY].[PROFILE_ID] = [TBEMLP_POLL_PROFILES].[GUID]
INNER JOIN [TBDD_EMAIL_ACCOUNT] (NOLOCK) ON [TBEMLP_POLL_PROFILES].[EMAIL_CONF_ID] = [TBDD_EMAIL_ACCOUNT].[GUID]
ORDER BY [TBEMLP_HISTORY].[GUID] ASC
GO
--################################ ENDE EMAIL-PROFILER ############################################
--################################# ZUGFERD #######################################################