【发布时间】:2015-11-09 08:39:36
【问题描述】:
希望这是一个新手问题。
因此,如果我的 SQL 中有很长的一组选择,而 where 子句中有几个子选择,我对视图设计器中的格式不太满意,这似乎是唯一的方法在保存后显示/显示我的视图。
那么,简而言之,有什么方法可以直接在 SSMS 中编辑我的视图,并让视图保留我代码中的格式?
即;
select case /*comment */
when a = 5
then b = 2
else b = 4 /* why b 4 */
end as field_1,
dt as field_2,...
全部搞定
select case /*comment */ when a = 5
then b = 2 else b = 4 /* why b 4 */
end as field_1,
dt as field_2,...
或者类似的东西。
【问题讨论】:
-
右键单击 -> 脚本视图为 -> 更改为 -> 新查询窗口。
标签: sql sql-server coding-style code-formatting query-designer