π New Online SQL Formatter β fast, free, and no signup required
SQL auto formatter
Can you recommend a sql formatter?
Is SSMS 21 not having a sql formatter a way to appease existing third party tools or an oversight?
Videos
What' the best options nowadays for SQL formatting?
There are many diverging conventions and SQL dialects, I know, but one standard must stand out so that we keep our sanity. Like python's black formatter.
What auto formatters are out there and what you recommend?
If you just want to do it quickly, why not utilize the RedGate Page?
https://www.red-gate.com/website/sql-formatter
Otherwise they have the formatter in their tool SQLPrompt as well, but it is not for free.
Other way to do it:
Visual Studio Code
Afaik there's also the option to format code.
But since you want to establish a standard ( I Really should start reading first all information before answering... :-) )
it is easier to go for an appropriate tool.
ApexSQL is another one where you can also define how T-SQL code should look like.
Regards
Dirk
You may refer the below link for few more options.
sql-formatters-beautify-your-code-and-coding-experience
Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
Blog
LinkedIn
Disclaimer: I know some developers will say using auto-formatting is a crutch/bad practice yada yada yada but I like it
Even though SSMS 21 is adding a lot of visual studio features and is based on visual studio, I noticed one thing it lacks is a formatter for sql. It looks like SSMS still relies on third party tools like Apex Refactor or Redgate SQL prompt for quickly formatting. Obviously the new features far outweigh the missing/lacking stuff but it got me thinking, is this intentional or an oversight?