Skip to content

Commit b53a4af

Browse files
authored
Merge pull request #14 from RoelantVos/bug-fixes-and-improved-exception-handling
Bug fixes and improved exception handling
2 parents 5180de1 + d5b977e commit b53a4af

24 files changed

+715
-218
lines changed

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,4 @@ ModelManifest.xml
242242
.fake/
243243

244244
.vscode
245-
020_DIRECT_Framework/Direct_Framework/Direct_Framework.jfm
246-
*.jfm
247-
*.jfm
248-
*.jfm
249-
020_DIRECT_Framework/Direct_Framework/Direct_Framework.jfm
250-
*.jfm
251-
*.jfm
252-
020_DIRECT_Framework/Direct_Framework/Direct_Framework.jfm
245+
*.jfm
-16 KB
Binary file not shown.

020_DIRECT_Framework/Direct_Framework/Direct_Framework.sqlproj

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SchemaVersion>2.0</SchemaVersion>
99
<ProjectVersion>4.1</ProjectVersion>
1010
<ProjectGuid>{b88ff268-22f9-4416-9e36-cfe598d243eb}</ProjectGuid>
11-
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
11+
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql150DatabaseSchemaProvider</DSP>
1212
<OutputType>Database</OutputType>
1313
<RootPath>
1414
</RootPath>
@@ -67,12 +67,12 @@
6767
<Folder Include="Tables" />
6868
<Folder Include="Views" />
6969
<Folder Include="Schemas" />
70+
<Folder Include="Reference_Databases" />
7071
</ItemGroup>
7172
<ItemGroup>
72-
<Build Include="Functions\omd.GetConsistencyDateTime.sql" />
7373
<Build Include="Functions\omd.GetDependency.sql" />
74-
<Build Include="Functions\omd.GetLoadWindowDateTimes.sql" />
75-
<Build Include="Functions\omd.GetLoadWindowModuleInstance.sql" />
74+
<Build Include="Functions\omd.GetModuleLoadWindowDateTime.sql" />
75+
<Build Include="Functions\omd.GetModuleLoadWindowIdentifier.sql" />
7676
<None Include="Scripts\InsertReferenceData.sql" />
7777
<Build Include="Tables\omd.AREA.sql" />
7878
<Build Include="Tables\omd.BATCH.sql" />
@@ -101,11 +101,11 @@
101101
<Build Include="Schemas\omd.sql" />
102102
<Build Include="Schemas\omd_processing.sql" />
103103
<Build Include="Schemas\omd_reporting.sql" />
104-
<None Include="Views\omd_processing.vw_CURRENT_PROCESSING.sql" />
104+
<Build Include="Views\omd_processing.vw_CURRENT_PROCESSING.sql" />
105105
<None Include="Views\omd_reporting.vw_QUEUE_PROGRESS.sql" />
106106
<None Include="Views\omd_reporting.vw_CURRENT_PROCESSING.sql" />
107107
<Build Include="Functions\omd.CalculateChangeKey.sql" />
108-
<None Include="Functions\omd_processing.NextModuleInQueue.sql" />
108+
<Build Include="Functions\omd_processing.NextModuleInQueue.sql" />
109109
<Build Include="Functions\omd_processing.GetDependentTables.sql" />
110110
<Build Include="Views\omd_reporting.vw_CUMULATIVE_LOAD_TIME.sql" />
111111
<Build Include="Views\omd_reporting.vw_EXCEPTIONS_BATCH.sql" />
@@ -118,12 +118,12 @@
118118
<Build Include="Views\omd_reporting.vw_EXCEPTIONS_NON_RUNNING_MODULES.sql" />
119119
<Build Include="Views\omd_reporting.vw_EXCEPTIONS_TABLE_CONSISTENCY.sql" />
120120
<Build Include="Stored Procedures\omd.TableCondensing.sql" />
121-
<None Include="Views\omd_processing.vw_QUEUE_BATCH_PROCESSING.sql">
121+
<Build Include="Views\omd_processing.vw_QUEUE_BATCH_PROCESSING.sql">
122122
<QuotedIdentifier>Off</QuotedIdentifier>
123-
</None>
124-
<None Include="Views\omd_processing.vw_QUEUE_MODULE_PROCESSING.sql">
123+
</Build>
124+
<Build Include="Views\omd_processing.vw_QUEUE_MODULE_PROCESSING.sql">
125125
<QuotedIdentifier>Off</QuotedIdentifier>
126-
</None>
126+
</Build>
127127
<Build Include="Stored Procedures\omd.CreateModuleInstance.sql" />
128128
<Build Include="Stored Procedures\omd.ModuleEvaluation.sql" />
129129
<Build Include="Stored Procedures\omd.RunModule.sql" />
@@ -142,8 +142,9 @@
142142
<Build Include="Functions\omd.GetFailedBatchIdList.sql" />
143143
<Build Include="Functions\omd.GetPreviousBatchInstanceDetails.sql" />
144144
<Build Include="Stored Procedures\omd.CreateLoadWindow.sql" />
145-
<Build Include="Functions\GetModuleAreaByModuleId.sql" />
145+
<Build Include="Functions\omd.GetModuleAreaByModuleId.sql" />
146146
<Build Include="Stored Procedures\omd.InsertIntoEventLog.sql" />
147+
<Build Include="Stored Procedures\omd.GetConsistencyDateTime.sql" />
147148
</ItemGroup>
148149
<ItemGroup>
149150
<PostDeploy Include="Scripts\Script.PostDeployment.sql" />
@@ -152,16 +153,21 @@
152153
<None Include="Build\Direct_Framework.publish.xml" />
153154
</ItemGroup>
154155
<ItemGroup>
155-
<ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac">
156-
<HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\130\SqlSchemas\master.dacpac</HintPath>
156+
<ArtifactReference Include="Reference_Databases\SSISDB.dacpac">
157+
<HintPath>Reference_Databases\SSISDB.dacpac</HintPath>
158+
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
159+
<DatabaseSqlCmdVariable>SSISDB</DatabaseSqlCmdVariable>
160+
</ArtifactReference>
161+
<ArtifactReference Include="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\150\SqlSchemas\master.dacpac">
162+
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\150\SqlSchemas\master.dacpac</HintPath>
157163
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
158164
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
159165
</ArtifactReference>
160166
</ItemGroup>
161167
<ItemGroup>
162168
<SqlCmdVariable Include="SSISDB">
163169
<DefaultValue>SSISDB</DefaultValue>
164-
<Value>$(SqlCmdVar__3)</Value>
170+
<Value>$(SqlCmdVar__1)</Value>
165171
</SqlCmdVariable>
166172
</ItemGroup>
167173
</Project>

020_DIRECT_Framework/Direct_Framework/Functions/omd.GetBatchModuleActiveIndicatorValue.sql

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
2-
3-
CREATE FUNCTION [omd].[GetBatchModuleActiveIndicatorValue]
1+
CREATE FUNCTION [omd].[GetBatchModuleActiveIndicatorValue]
42
(
5-
@ModuleId INT,
6-
@BatchId INT
3+
@BatchId INT,
4+
@ModuleId INT
75
)
8-
RETURNS VARCHAR(1) AS
6+
RETURNS VARCHAR(3) AS
97

108
-- =============================================
119
-- Function: Get the Batch/Module active/inactive flag.
@@ -15,7 +13,7 @@ RETURNS VARCHAR(1) AS
1513
BEGIN
1614
-- Declare ouput variable
1715

18-
DECLARE @InactiveIndicator VARCHAR(1)
16+
DECLARE @InactiveIndicator VARCHAR(3)
1917

2018
SET @InactiveIndicator =
2119
(
@@ -28,7 +26,7 @@ BEGIN
2826
WHERE BATCH_ID = @BatchId AND MODULE_ID = @ModuleId
2927
UNION
3028
-- Return if there is nothing, to give at least a result row for further processing
31-
SELECT null
29+
SELECT 'N/A'
3230
) sub
3331
)
3432

020_DIRECT_Framework/Direct_Framework/Functions/omd.GetConsistencyDateTime.sql

Lines changed: 0 additions & 95 deletions
This file was deleted.
File renamed without changes.

020_DIRECT_Framework/Direct_Framework/Functions/omd.GetModuleIdByName.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ BEGIN
1919
WHERE MODULE_CODE = @ModuleCode
2020
)
2121

22-
SET @ModuleId = COALESCE(@ModuleId,0)
23-
2422
-- Return the result of the function
2523
RETURN @ModuleId
2624
END

020_DIRECT_Framework/Direct_Framework/Functions/omd.GetLoadWindowDateTimes.sql renamed to 020_DIRECT_Framework/Direct_Framework/Functions/omd.GetModuleLoadWindowDateTime.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE FUNCTION [omd].[GetLoadWindowDateTimes] ( @ModuleId INT, @start_or_end tinyint)
1+
CREATE FUNCTION [omd].[GetModuleLoadWindowDateTime] ( @ModuleId INT, @start_or_end tinyint)
22
RETURNS DATETIME2(7) AS
33
BEGIN
44
DECLARE @result DATETIME2(7)

020_DIRECT_Framework/Direct_Framework/Functions/omd.GetLoadWindowModuleInstance.sql renamed to 020_DIRECT_Framework/Direct_Framework/Functions/omd.GetModuleLoadWindowIdentifier.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE FUNCTION [omd].[GetLoadWindowModuleInstance] ( @module_code VARCHAR(255), @start_or_end tinyint)
1+
CREATE FUNCTION [omd].[GetModuleLoadWindowIdentifier] (@ModuleId INT, @start_or_end tinyint)
22
RETURNS BIGINT AS
33
BEGIN
44
DECLARE @result BIGINT
@@ -15,7 +15,7 @@ BEGIN
1515
ROW_NUMBER() OVER (PARTITION BY MODULE_ID ORDER BY INSERT_DATETIME DESC) AS ROW_NR
1616
FROM omd.SOURCE_CONTROL sct
1717
JOIN omd.MODULE_INSTANCE modinst ON sct.MODULE_INSTANCE_ID = modinst.MODULE_INSTANCE_ID
18-
WHERE MODULE_ID = (SELECT MODULE_ID FROM omd.MODULE module WHERE module.MODULE_CODE=@module_code)
18+
WHERE MODULE_ID = @ModuleId
1919
) ranksub
2020
WHERE ROW_NR=1
2121
END
@@ -31,7 +31,7 @@ BEGIN
3131
ROW_NUMBER() OVER (PARTITION BY modinst.MODULE_ID ORDER BY sct.INSERT_DATETIME DESC) AS ROW_NR
3232
FROM omd.SOURCE_CONTROL sct
3333
JOIN omd.MODULE_INSTANCE modinst ON sct.MODULE_INSTANCE_ID = modinst.MODULE_INSTANCE_ID
34-
WHERE MODULE_ID=(SELECT MODULE_ID FROM omd.MODULE module WHERE module.MODULE_CODE = @module_code)
34+
WHERE MODULE_ID = @ModuleId
3535
) ranksub
3636
WHERE ROW_NR=1
3737
END
190 KB
Binary file not shown.

0 commit comments

Comments
 (0)