Format SQL in SQL Server Management Studio

后端 未结 2 687
野趣味
野趣味 2020-11-29 15:36

In Visual Studio & other IDEs, you can easily auto format your code with a keyboard shortcut, through the menu, or automatically as you type.

I was wondering if

2条回答
  •  星月不相逢
    2020-11-29 16:01

    There is a special trick I discovered by accident.

    1. Select the query you wish to format.
    2. Ctrl+Shift+Q (This will open your query in the query designer)
    3. Then just go OK Voila! Query designer will format your query for you. Caveat is that you can only do this for statements and not procedural code, but its better than nothing.

提交回复
热议问题