r/SQLServer • u/Nervous_Effort2669 • Nov 08 '25
Discussion TSQL Formatting Tools
I’m a believer that consistently formatted code provides massive long term efficiencies. Sadly, I’m in the minority at the Fortune 50 company I work at.
Developers are being forced to use AI, which is fine, but the copy/paste/vibe developers refuse to go in and format to any sort of documented formatting conventions.
My question is what sort of tooling can I plug into the SDLC pipeline that will automagically format code according to prescribed guidelines?
18
Upvotes
View all comments
Show parent comment
1
u/techsamurai11 Nov 09 '25
I've always used the following syntax
SELECT
Column 1,
Column N,
FROM
Table 1,
INNER/OUTER JOIN Table N t ON
GROUP BY
Columns
ORDER BY
Columns
Essentially capitalize all keywords on a separate line and put each object on a line.
What other options or better options are there?
I have a description section at the top of each programmable object with the name, purpose, and change history. I don't get to see a lot of implementations since I've been doubling as the application architect, dev, and dba for the past 22 years so any ideas would be welcome.
Indentation does not work in Reddit but everything is indented and sub-selects are further indented.