Can you recommend a sql formatter?

Chris Sijtsma 106 Reputation points
2020-11-17T14:17:45.18+00:00

Dear colleagues,

Which SQL formatter would you recommend? In our organization, we have coding standards. My problem is, there are to many of them. As I am responsible for the repositories containing SQL, I want to enforce a single standard by automatically formatting the code in check-in. I would like to have some configuration options to tweak the format to my liking.

Thanks for your help,
Chris

Developer technologies | Transact-SQL
SQL Server | Other
{count} votes

Accepted answer
  1. Dirk Hondong 876 Reputation points
    2020-11-17T14:39:24.05+00:00

    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

    2 people found this answer helpful.

12 additional answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.