Format SQL Code

SSMSBoost allows to format SQL Code using two different formatting engines.

SSMSBoost formatting engine

SSMSBoost formatting engine offers a wide variety of options. The best way to learn it is by using Built-In Template editor: it will apply changes to the formatting template while you edit it.

To create/edit formatting template:
  • Open one of your SQL scripts - it will be used to display formatting result while you change options
  • Run SSMSBoost menu->Query->SQL Format Styles template editor
  • Change template options and they will be immediately applied to your code.
  • Hit "Save changes" when you are done

Now you have created your own formatting template, you can choose it on the toolbar in the formatting drop-down and hit "Format" anytime to format your SQL code.
Under SSMSBoost settings->Formatting you can manage formatting templates as well, particularly - you can import/export them, to share templates with your colleagues.

SSMSBoost code formatting in SSMS

"Poor Man's T-SQL Formatter"

This formatter is added as an external tool, which SSMSBoost calls in the background. The project is called "Poor Man's T-SQL Formatter" and is displayed as "Old styled formatting" in formatting drop-down. Project author Tao Klerk did not update it for several years but many users were asking if it is possible to use this formatter under latest SSMS versions, so we decided to link it into our add-in.
You can configure formatting options under SSMSBoost settings->Formatting->Old fashioned formatting.