Making SSMS Pretty: My Dark Theme

Updated November 26, 2019

I've been using a dark theme in SSMS for some time now. For myself, I find it far easier to read light on dark, if you choose the right colors. 

Here is a code sample:

  FROM sys.all_columns AS c
  LEFT OUTER JOIN sys.all_objects AS o
  ON c.[object_id] = o.[object_id]
  /* ORDER BY something */
EXEC sys.sp_help;

And here is a screenshot of the same code in my local copy of SSMS:

SSMS Dark Mode Screenshot

The only real difference, which you may have spotted, is that WP-GeSHi treats ambiguous words like LEFT and RIGHT as if they were built-in functions (which they are), while SSMS treats them as keywords (which they also are).

There are two ways to go about this:

1. You can set the color settings manually

2. You can import my theme via a .vssettings file that I share below

Doing this the hard way

You can do this manually, of course. Go to Tools / Options / Environment / Fonts and Colors. Highlight text editor and make the background dark and the foreground light:

Tools Option Screenshot

(Mine areRGB(228,228,228) for Item foreground andRGB(50,50,50) for Item background.)

Then go down the list and change the "Item foreground" color for things you want to change, using the Custom... button. Put a snippet of text in a query window that has just about everything - DMVs, functions, keywords, system procedures, comments, highlighted text, string, etc. so you can see the effects after every change.

You'll have to play with it on your own to get the settings you like. Here are some of the other customizations I've made (the update is that I've chosen a slightly different pink for built-in functions, changed SQL stored procedures to green in order to match DMVs and system tables, and changed comments to orange):

  • Comment:RGB(255,175,45)
  • Keyword:RGB(127,176,228)
  • Script Comment:RGB(255,175,45)
  • Script keyword: CyanRGB(0,255,255)
  • Script string: YellowRGB(255,255,0)
  • SQL Operator:RGB(199,199,199)
  • SQL Stored Procedure:RGB(128,255,128)
  • SQL String: YellowRGB(255,255,0)
  • SQL System Function:RGB(220,120,255)
  • SQL System Table:RGB(128,255,128)

I also make size changes for text results and grid results (which require a restart of the application to take effect), and I change grid results from MS Sans Serif to Calibri, and text results from Courier New to Consolas.

Doing this the smart way

A while back, Doug Holland blogged about using the VSSettings file to share themes. (In fact, you may like his color scheme better than mine.)

After the one-time manual process above, it was easy to share the .vssettings file so that I could implement the same color scheme on other machines.

First, I need to go to Tools, Import and Export Settings, and choose "Export selected environment settings:

Tools Menu in SSMS Screenshot

SSMS Wizard - Import and Export Screenshot

Then I select only the checkbox for All Settings > Options > Environment > Fonts and Colors:

SSMS Wizard Import and Export

Note: I also use pretty big fonts in order to minimize the need to zoom anything when presenting. So I've created two separate files, one with LargeFonts in the name, and one with NormalFonts. You can download them below and start from whichever one is more appropriate for you.

To import them, you follow the wizard in almost the same way. Go to the same menu item, but this time choose Import selected environment settings. You will be prompted to save your current settings (a good idea; in the event you can't stand my colors, it will be easy to revert):

SSMS Import and Export Wizard - Screenshot

Then you will likely have to move the above files into your Documents \ SQL Server Management Studio \ Settings \ SQL Server Management Studio folder to have them show up here:

SSMS Wizard Importing Theme

Then the following options should be the only ones selected, and you can choose Finish:

SSMS Wizard - Choosing Settings

Note that some settings may not take effect until you re-launch Management Studio (grid and text result settings are still sticky even in the most recent SQL Server 2016 version).

I keep these two files on a thumb drive and in the cloud so that, no matter where I am, it's drop-dead simple to switch sensible coding font sizes to making all of my code and results readable to the nosebleed seats in a large room at a conference. I'm thinking about adding other options to my switch files too, like returning results in a separate tab, including the query output in the results, and other things I tend to do only when demoing / presenting.

Note: this should work for Visual Studio as well, but I haven't tried it (and my specific customizations won't affect most of what you do in VS anyway). Enjoy, and let me know if you have any suggestions or what additional customizations you have made.