44

I have it enabled in Visual Studio 2008, but I'd really like to enable this feature in SQL Server Management Studio 2005 Express. Does anyone know if its possible? Maybe in a later version?

EDIT: Sorry, I meant specifically in the text/query editor.

Pandincus
  • 9,506
  • 9
  • 43
  • 61
  • Could you be more specific? Do you mean in the query window, results window, etc.? Why do you need to do this? – Simon Chadwick May 03 '10 at 18:19
  • @Simon Chadwick: Sorry, I meant the query/text editor. Need? No need. Just wanted to customize the look and feel, similar to how I have my VS 2008 editor. For example, you can customize the fonts and colors ... 'view whitespace' is another nice little feature. I don't think its possible, but there's plenty of hidden options buried in there so I thought someone on StackOverflow might know how to do it. ...the answer can also be "No." – Pandincus May 03 '10 at 22:15

4 Answers4

51

In case you still need to know how to do this.

Edit the Registry Key in HKEY_CURRENT_USER:

Software\Microsoft\Microsoft SQL Server\xx\Tools\Shell\Text Editor\Visible Whitespace

Where xx is the version you have (90 is 2005, 100 is 2008)

And set it to 1 to show. Or for SQL Server 2012 and up client tools it is also in HKCU:

Software\Microsoft\Microsoft\SQL Server Management Studio\v\Text Editor\Visible Whitespace

where v in SQL Server 2012 is 11.0 and in SQL Server 2014 is 12.0.

ErikE
  • 48,881
  • 23
  • 151
  • 196
Andir
  • 2,063
  • 1
  • 15
  • 22
  • 11
    I'm shocked and horrified that it takes a registry setting to change visibility of white space since the color of white space is so easy to set in the options. But you're right, so +1 to you sir. – Bernhard Hofmann Jun 12 '13 at 10:25
  • 3
    For what it's worth, I found the option for SQL 2012 under: HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio \11.0\TextEditor -> Visible Whitespace – Arowin Oct 27 '14 at 22:14
  • Can we also do the same for Results Grid View? – Jakub P. Jun 11 '15 at 09:13
  • 1
    For anyone shocked as @BernhardHofmann, keep scroling, in new versions it can be done with a key combination now! :D – Sebastián Vansteenkiste Feb 20 '20 at 14:52
32

Try doing Ctrl R, Ctrl W (or activate from menu Edit > Advanced > View White Space).

This is Edit.ViewWhiteSpace command (you can see this in Tools>Options>Keyboard) and should be assigned to that keyboard combination. You can in fact also type this command in Command Window (Ctrl+Alt+A).

This worked for me with Server Management Studio 11.0.2100.60.

Daniel Lidström
  • 9,930
  • 1
  • 27
  • 35
25

Starting in SSMS 2012 this is available in Edit > Advanced > View White Space

Alejandro
  • 7,290
  • 4
  • 34
  • 59
Andrewww
  • 271
  • 3
  • 6
3

SSMS (2005, I don't know about 2008) does not provide this functionality.

However, you could use a font that uses visible glyphs for spaces and tabs, like this: https://i.stack.imgur.com/Xc1Pw.jpg

I used a free font editor called Type Light to make a copy of an existing font, with a visible space glyph.

I know it's a hack, but where there's a will there's usually a way...

Simon Chadwick
  • 1,148
  • 6
  • 12
  • 1
    @Simon Chadwick Yeah, I figured it didn't have the functionality, but I just wanted someone to confirm it for me (couldn't find it anywhere on Google!) At any rate, that's a clever workaround -- I think I'll give it a shot! – Pandincus May 04 '10 at 12:45