Easier way to read your TSQL code in SSMS with word wrap feature
By: Atif Shehzad | Updated: 2008-11-10 | Comments (5) | Related: More > SQL Server Management Studio
While creating T-SQL scripts with lengthy T-SQL lines you have one of two options; either use the horizontal scroll bar or create line breaks at various points to make the line readable without having to use the scroll bar. Scrolling or having to break the lines of code takes time away from paying attention to coding. It would be nice if there was a word wrap option or something similar. Are there are any options in SQL Server Management Studio to handle word wrap?
Line many new features in SQL Server Management Studio (SSMS), Microsoft has also addressed the word wrap issue. You can easily turn on this feature for the SSMS query pane, just follow the steps below to turn on this feature..
From the SSMS menus select "Tools" and then "Options"
In the "Options" window select "All Languages" on the left side. On the right side under Settings there is a "Word wrap" option which is unchecked by default as shown below.
Check the check box for "Word wrap" and this will enable word wrap for your query pane. Another option under word wrap is "Show visual glyphs for word wrap" this option if checked places a visual mark for each line where the word wrap is applied.
Without either option enabled the below image shows what is displayed in SSMS.
After turning on both options ("Word wrap" and "Show visual glyphs for word wrap") your long query lines are displayed as follows. The highlighted characters below show the "visual glyphs" where the word wrap has been applied.
- With the word wrap option turned on you can focus more on your coding, logic and flow of your T-SQL script without having to scroll. So turn it on along with visual glyphs and get rid of scrolling and having to create manual line breaks.
- There are two other options under "Text Editor" where you can also apply this feature. If you select "All Languages" and turn on these features this will also apply to these two features as well.
- "Plain Text" - this applies to other documents such as text documents
- "XML" - this applies to XML documents
Last Updated: 2008-11-10
About the author
View all my tips