Missing spaces after parentheses
orderbynewid
Posts: 6 New member
- SQL Prompt version: 10.14.4.4865
- SQL Server Management Studio version: 19.2.56.2
- SQL Server Version:
- Microsoft SQL Azure (RTM) - 12.0.2000.8
- Microsoft SQL Server 2022 (RTM-GDR) (KB5029379) - 16.0.1105.1 (X64)
- Database Compatibility Level: 160
- Active Style: Default
Before formatting
SELECT '1' COLLATE DATABASE_DEFAULT AS a, SPACE(2) COLLATE DATABASE_DEFAULT AS b, TRIM('3') COLLATE DATABASE_DEFAULT AS c, STRING_AGG('4', '5') WITHIN GROUP(ORDER BY NEWID()) AS d;
- This is the expected result
After formatting
SELECT '1' COLLATE DATABASE_DEFAULT AS a, SPACE(2)COLLATE DATABASE_DEFAULT AS b, TRIM('3')COLLATE DATABASE_DEFAULT AS c, STRING_AGG('4', '5')WITHIN GROUP(ORDER BY NEWID()) AS d;
- Notice the missing spaces after the parentheses
Tagged:
Comments
Thank you for your post.
You would need to create a new format style and then, under the "Function Calls" section, check the option to include a whitespace after parentheses.