SQL Server 2005 中的代码对齐
我正在使用 SQL Server Management Studio。
我想知道以美观的格式轻松对齐 T-SQL 查询和代码的快捷方式,以便于阅读和理解。
请让我知道如何在不使用任何 SQL Server 格式化/对齐工具的情况下对齐代码。
请提供您宝贵的提示来对齐相同的内容,现在对齐代码,我的意思是使用 TAB 和 SPACE BAR 键使代码左右对齐,当代码长度增加时,这会变得非常困难。
I am using SQL Server Management Studio.
I want to know the shortcuts for easily aligning the T-SQL Queries and codes in a beautiful format for easy readability and understandability.
Please Let me know how to align the code without using any SQL Server formatting / aligning tools.
Please do give your valuable tips to align the same, right now to align the code i mean to make the code right and left aligned i m using the TAB and SPACE BAR key which becomes very difficult when the length of code is increasing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还发现与 Visual Studio 中的功能相比,SQL Server Management Studio 缺乏自动格式化功能有点令人沮丧。
考虑升级到 SQL Server 2008 工具集以获得一些格式化功能。一个突出的功能是它“记住”您在上一行中缩进的位置(不确定这是 2005 年还是 2008 年的功能)。
还可以考虑一些在线 SQL 格式化工具:
在线代码格式化可节省大量时间。如果您的目标是快速格式化代码,那么没有什么比复制/粘贴更容易、更快捷的了。
I also find SQL Server Management Studio's lack of auto-formatting a bit frustrating, compared to the functions in Visual Studio.
Consider upgrading to the SQL Server 2008 toolset for a handful of its formatting features. One feature that stands out is that it 'remembers' where you had indented to in the previous line (not sure if this was a 2005 or 2008 feature).
Also consider some online SQL formatting tools:
Online code formatting saves an incredible amount of time. If your goal is to quickly format your code, it couldn't get much easier and quicker than copy/paste.