Skip to content

Using non-existent metadata in the query (QueryToMissingMetadata)

Type Scope Severity Activated
by default
Minutes
to fix
Tags
Error BSL Blocker Yes 5 suspicious
sql

Description

Due to frequent changes to the metadata model, queries may appear that refer to renamed or deleted metadata. Also, errors can occur when you manually change queries, without checking with the query designer.

When accessing non-existent metadata in a query, a runtime error will occur.

Examples

Query for an already deleted register:

SELECT
    Table.Field1 AS Field1
FROM
    InformationRegister.InfoRegOld AS Table
Query with a join to the renamed register:
SELECT
    Table.Field1 AS Field1
FROM
     InformationRegister.InfoReg AS Table 
     INNER JOIN InformationRegister.InfoRegOld AS FilterTable
     ON FilterTable.Field2 = Table.Field2

Sources

Snippets

Diagnostic ignorance in code

// BSLLS:QueryToMissingMetadata-off
// BSLLS:QueryToMissingMetadata-on

Parameter for config

"QueryToMissingMetadata": false