TRIM with LEADING/TRAILING/BOTH breaks formatting on Azure SQL Database

orderbynewidorderbynewid Posts: 6 New member
edited December 10, 2023 3:47PM in SQL Prompt
  • SQL Prompt version: 10.14.4.4865
  • SQL Server Management Studio version: 19.2.56.2
  • Database Compatibility Level: 160
  • Active Style: Default

Before formatting

sElEcT tRiM(lEaDiNg '0' fRoM '01') AS Description,
    2 AS Period,
    3 AS Precision,
    4 AS Scale,
    5 AS MyColumn

After formatting when connected to Microsoft SQL Server 2022 (RTM-GDR) (KB5029379) - 16.0.1105.1 (X64)

SELECT TRIM(LEADING '0' FROM '01') AS Description,
    2 AS Period,
    3 AS Precision,
    4 AS Scale,
    5 AS MyColumn;
  • This is the expected result

After formatting when connected to Microsoft SQL Azure (RTM) - 12.0.2000.8

SELECT TRIM(lEaDiNg '0' FROM '01') AS DESCRIPTION,
    2 AS PERIOD,
    3 AS PRECISION,
    4 AS Scale,
    5 AS MyColumn;
  • lEaDiNg is not cased correctly
  • Some column aliases are incorrectly made uppercase

Comments

Sign In or Register to comment.