I dictate SQL using speech recognition, and lining things up is a pain. If I could see where the tab stops are it would save me a lot of time.
-
1@DylanCorriveau, the tag that you edited is already a tag synonym of the tag that was on the question. Flooding the edit review queue with edits on five, six, seven year old questions thta do nothing but change tags adds no value to these posts and wastes reviwer's time - I highly encourage you to stop and to find more impactful editing opportunities if you're interested in helping the community. – Sam Hanley May 12 '15 at 17:18
2 Answers
Management Studio supports an undocumented feature that Visual Studio has as well. It adds vertical guide lines to the editor window at specific column locations.
Create a .reg file using the text below and open it to merge it with your registry. This will add a line every 8 characters (up to column 96) in SQL Server 2005. Modify as needed to suit your tab size. It does not appear to support more than 12 lines. The RGB portion of the string is supposed to set the color, but it always displays as black for me. You'll quickly notice why this is an undocumented feature - the lines appear in unwanted locations such as the Messages output window.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\Shell\Text Editor]
"Guides"="RGB(128,0,0) 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96"

- 1
- 1

- 5,211
- 6
- 39
- 53
-
Thanks for this – and I wanted to remove the pesky vertical lines! I did have a little trouble finding the value in the registry (wasn't quite where the above said it was), but all I did was a registry search for my lines ("80, 100, 120") and eventually I was able to delete the offending entry. Incidentally I got the lines because I tried SSMSBoost, however the lines remained after the "uninstall". – Andrew Jens Jul 07 '15 at 06:05
Perhaps SQL Refactor by Red Gate. You can define the desired layout of the code, and then simply use command "Lay Out SQL".
When you install SQL Refactor it adds extra menu item to the Management Studio main menu. Each command has its keyboard shortcut (e.g. for Lay Out SQL it is Ctrl+B Ctrl+L) so I assume you should be able to assign that command to your speech recognition tool.
SQL Refactor comes with the price but you can be download 14-day full working trial to try it it serves your needs.

- 52,923
- 24
- 87
- 110
-
I think my company has this tool (it was included with a package of products). I'll have to take a look and see if it supports our formatting standards. – Keith Walton Dec 02 '08 at 16:01