How can we help you today? How can we help you today?

SQL Prompt incorrectly uppercases CLR method names after :: operator (case-sensitive issue)

Hi,

I’d like to report what appears to be an issue with SQL Prompt formatting related to CLR method calls.

Problem

When formatting T-SQL code that calls a CLR method using the scope resolution operator (::), SQL Prompt automatically uppercases the method name.

Example:

DECLARE @MappingRule dbo.EntityInstanceMappingRule;

SELECT @MappingRule = dbo.EntityInstanceMappingRule::Get(
    CONVERT(uniqueidentifier, '01234567-89AB-CDEF-0123-456789ABCDEF')
);

After formatting, SQL Prompt changes:

::Get

to:

::GET

Why this is problematic

The identifier after :: is not a T-SQL keyword.
It is a .NET CLR method, and therefore case-sensitive.

Changing Get to GET is not just a stylistic modification — it can break code or cause mismatches in environments where CLR methods rely on case sensitivity.

The formatter appears to treat the token after :: as a regular identifier or keyword, but in this context it represents a CLR member and should not have its casing altered.

Environment

  • SQL Prompt version: 11.3.6.21421
  • SQL Server Management Studio: 22.3.2
  • OS: Windows 11 Pro 24H2
  • .NET Framework: 4.0.30319.42000
luca.cestola
0

Add comment

Please sign in to leave a comment.