DF097: A parameter or variable has a different case than its declaration.

The topic describes the DF097 T-SQL code analysis rule.

Category

STYLE

Message

A parameter or variable has a different case than its declaration.

Description

It is recommended to use the same case for parameter or variable declaration and usage, as inconsistent case may result in code breakage when deployed on a case-sensitive server instance.

Additional information

Having a parameter or variable with a different case than its declaration can lead to confusion and potential errors in the code. This is because programming languages are often case-sensitive, meaning that “VariableName” and “variablename” would be treated as two separate entities. As a result, using inconsistent casing can make the code harder to read and maintain, and it may lead to unexpected behavior or bugs, especially when the code is deployed on systems that enforce case sensitivity.

Noncompliant code example

DECLARE @Dim INT
SET @Dim = 0

Compliant solution

DECLARE @Dim INT
SET @Dim = 0