Formatting SQL by SQL Management Studio without add-on

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

image

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]

image

 

Query Designer pop up

image

 

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 ~

posted @ 2011-06-08 11:32  Jerry Chou  阅读(477)  评论(2编辑  收藏  举报