
There are multiple ways of giving indents and changing the length of tab spaces for a SQL query in MS SQL Server management studio. Custom SQL Query Formatting using SQL Editor, Text Editor and Edit Tools We can even format a query with personal customization, by giving indentations, tab spaces, commenting and uncommenting etc. Until now, we have been formatting the query using an automatic query designer. The formatted SQL query would look something as shown below. Modify the query as you want and click on Ok. Just select the query you want to format and press Ctrl+Shift+Q on the keyword.Ī query designer dialog box will appear in front of you. In order to format this SQL query, we will use the shortcut. Select * from dbo.books_audit_table where This might seem like a lot of steps but you can open the query designer by using a shortcut Ctrl+Shift+Q. And when you click on Ok and the original query will get formatted automatically as shown below. You can even see the preview of your formatted query in the lower section. Step 3: After you have formatted the query in the desired manner, click on OK.

You can select the names of the columns you want in the formatted query and all.

Step 2: Once you select the Design Query in Editor option, a Query Designer dialog box as shown below will appear in front of you. Select Design Query in Editor option from it. On clicking on the Query tab, a drop-down menu as shown below will appear on the screen. Step 1: Click on the Query tab in the bar just below the main bar. In order to format this query, we can use the query designer. Hadoop, Data Science, Statistics & others
