开发者

Code Alignment In SQL Server 2005

开发者 https://www.devze.com 2022-12-22 20:57 出处:网络
I am using SQL Server Management Studio. I want to know the shortcuts for e开发者_StackOverflow社区asily aligning the T-SQL Queries and codes in a beautiful format for easy readability and understand

I am using SQL Server Management Studio.

I want to know the shortcuts for e开发者_StackOverflow社区asily 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.


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:

  • SQLInform's online SQL formatter - requires Java in your browser.
  • SQLRefactor from Red Gate - ~$300
  • Instant SQL Formatter online at dpriver.com Apparently they have a SQL Management Studio plugin for $50
  • SQL Format at apspot.com

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.

Code Alignment In SQL Server 2005

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号