Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to view whitespace in SQL Server Management Studio 2016?

Tags:

It doesn't look to me like there's any menu option which enables whitespace to be viewed in the text editor.

There's a similar question here, however this is referring to SSMS Express 2005 . An answer to this question shows how whitespace viewing can be enabled by editing registry values. However, i don't have that path specified in my registry. (I've checked each dir in the SQL Server registry and can't find a 'Visible Whitespace' entry)

I am using SQL Server Management Studio 2016 (v 13.0.15500.91)

Surely there must be a way to achieve this. It's not really required but I would like my settings to match my other versions of SSMS.

like image 670
DNKROZ Avatar asked Aug 23 '16 14:08

DNKROZ


People also ask

How can I get beautify code in SSMS?

The SSMS Add-in allows you to set your own hotkey (default is Ctrl - K , Ctrl - F , to match Visual Studio), and formats the entire script or just the code you have selected/highlighted, if any. Output formatting is customizable.

Does SQL care about whitespace?

Whitespace is optional in pretty much any language where it is not absolutely necessary to preserve boundaries between keywords and/or identifiers. You could write code in C# that looked similar to your SQL, and as long as the compiler can still parse the identifiers and keywords, it doesn't care.


2 Answers

The option is under: Edit > Advanced > View White Space

like image 59
DNKROZ Avatar answered Sep 19 '22 20:09

DNKROZ


You can also add this to a toolbar:

  • In the Customize Toolbar window, click "Add Command"
  • Click "Edit" in the Categories list
  • Choose "Toggle Visual Space" in the Commands list
  • Click "OK"
  • Move the button where you want it, then click "Close"
like image 31
David Bippes Avatar answered Sep 17 '22 20:09

David Bippes