D Rickard
D Rickard

Reputation: 153

Column guides in editor for SQL Server Management Studio 2012

Is there a way to get column guides (e.g. a vertical line at column 80) in SSMS 2012? I see ways to do this in Visual Studio 2012 and previous versions of SSMS, but I don't see anything for SSMS 2012.

I tried a new string called Guides with the value RGB(128,0,0) 80 at HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0\Text Editor, but after restarting SSMS 2012 there was no guide line.

Upvotes: 2

Views: 4538

Answers (2)

Andrei Rantsevich
Andrei Rantsevich

Reputation: 2935

SSMS 2012 has updated editor control, that does not support "simple" way to display guidelines, as it was in 2008 (using registry settings).

I develop SSMSBoost add-in (www.ssmsboost.com) and in last release (v.2.12) we have added Guidelines functionality for SSMS 2012. It is 100% "hand-made" functionality - we needed to write own handler to implement it. You can define several guidelines (several column positions) and their color. Also we have added support to easily configure guidelines for SSMS 2008, without using the registry editor.

Upvotes: 5

Simon Elms
Simon Elms

Reputation: 19648

OK, it's do-able. It all hinges on being able to install the Visual Studio 2010 Editor Guidelines extension into SSMS 2012.

I'd previously installed the Editor Guidelines extension to Visual Studio 2010. Here is the download page on the Visual Studio Gallery site (linked to in one of your Stackoverflow references). Note that you need to install the Visual Studio 2010 extension, not the Visual Studio 2012 one (as SSMS 2012 is based on VS 2010, not VS 2012).

Now you need to find the extension folder for SSMS 2012. This blog post from Brad Gearon pointed me in the right direction. I found it at C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Extensions\ .

Next you need to find the Editor Guidelines extension you previously installed into Visual Studio 2010. This Visual Studio blog post pointed me to the master devenv.pkgdef file, which lists the various locations extensions can be saved to for Visual Studio 2010. After trying various of the locations in the devenv.pkgdef file, I stumbled on the Editor Guidelines extension in C:\Users{your username}\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\ . The extension is just a folder with a random seeming name, in my case zdtycyqi.0zr. I had several extensions installed and, to find the right one, I went through each of the folders with the random names, opening the extension.vsixmanifest file in each. Each extension.vsixmanifest file has a description element. The one I selected had the description "Adds vertical column guides to the editor. Uses the same registry syntax as previous versions of Visual Studio.".

Now all you do is copy the whole folder containing the extension (in my case folder zdtycyqi.0zr ) from the Visual Studio extensions folder into the SSMS 2012 extensions folder.

To add guidelines I created a string value called Guides in registry key HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\11.0\Text Editor. To set a guideline at column 100 I set the value of Guides to "RGB(196,0,0) 99".

Now when I open a query window in SSMS 2012 I see a dark red guideline at column 100.

Upvotes: 0

Related Questions