Formatting SQL by SQL Management Studio without add-on

We do not want to view a mess of sql statement. such as

Formatting SQL by SQL Management Studio without add-on_第1张图片

There is no indent, mixing the lowercase and uppercase keywords. Is there any way to format this sql statement by SQL Management Studio?

 

Maybe add-on to the SQL Management Studio come up to you sight first, but there is easy way to format the sql without add-on.

First, select the sql statement that you need to formatting, then right-click and choose [Design Query in Editor]

Formatting SQL by SQL Management Studio without add-on_第2张图片

 

Query Designer pop up

Formatting SQL by SQL Management Studio without add-on_第3张图片

 

In bottom of Query Designer, the sql statement has been formatted. You can copy formatted sql to anywhere, further more,  editing sql statement in Query Designer directly.

 

Have fun ~

你可能感兴趣的:(format)