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
1

Comments

1 comment

  • Christian Perez
    Official comment

    Hi Luca,

     

    Hope you are doing well today, thanks for reaching out to Redgate Support. I was able to reproduce this issue in my local environment and as such, I am going to raise a dev ticket to get this remediated in a future version of Prompt. That being said, if you toggle your active style and configure Global > Casing > Reserved Keywords > "Leave as is" that will function as a temporary workaround so Prompt does not change the casing of the ::get portion of the query.

    Once I know more from development on the casing behavior, I will circle back here and let  you know what shakes out.

    Christian Perez

Add comment

Please sign in to leave a comment.