r/SQL • • Jun 26 '26

SQL Server SQL Indentation

I am working on MS SQL. I have got few scripts of 1000+ line with poor indentaion.

Any tool which i cna use to properly format it.
Please suggest

26 Upvotes

44 comments sorted by

View all comments

Show parent comment

14

u/alinroc SQL Server DBA Jun 26 '26

SSMS has a Format Source Code option.

Note: Only the most recent version, 22.7 and up. And it's still lacking a lot of options (like leading instead of trailing commas).

The N++ plugin is Poor Man's T-SQL Formatter. Which is also available online at https://poorsql.com

3

u/MachineParadox Jun 26 '26

And there is a vs code extenaion for poor man's as well