SQL Server Management Studio Dark Mode

By:   |   Updated: 2022-04-18   |   Comments (15)   |   Related: 1 | 2 | 3 | 4 | 5 | 6 | 7 | > SQL Server Management Studio Configuration


Problem

You're using SQL Server Management Studio (SSMS) and would like to use Dark Mode. You've looked at the configuration options and don't see a way to configure it.

Solution

We'll look at some reasons a user would prefer Dark Mode, a brief history of it and how to configure SSMS to add it as an additional Color Theme option.

Reasons for using Dark Mode

While there is no conclusive evidence to support medical claims, these are some of the reasons a user would prefer Dark Mode over Light Mode.

  • Less light coming back toward your eyes
  • Less glare
  • It just looks better to them
  • Reduced eye strain
  • Less energy used
  • Extended laptop battery charge
  • Reduced blue light exposure
  • Easier to read
  • Reduced eye dryness

History of Dark Mode

Before we see how to configure Dark Mode in SSMS, let's look at a brief history of computer displays. Dark Mode simply means a dark, or unlit screen background that is displaying lit up text or graphics. Early computer screens were Cathode Ray Tubes (CRT) that were developed for radar systems during WWII. It simply wasn't practical with this technology to light up an entire screen, so the screen was dark, and the characters were lit up. These screens were Dark Mode even it wasn't referred to by name at the time. They were just called computer screens.

To show how those screens looked, here is a picture of an International Business Machines (IBM) Personal Computer with a monochrome monitor and an Applied Digital Data Systems (ADDS) Viewpoint dumb terminal. Text was displayed in green (and sometimes in amber or white) on a dark unlit background. Both date back to the 1980s.

IBM PC with a monochrome monitorADDS Viewpoint Dumb Terminal

As color monitors and graphics video cards became the norm and CRTs gave way to Liquid Crystal Displays (LCD), text and graphics were able to be displayed on a white background to look more like a page printed on paper. And as with so many things, it's gone full circle and Dark Mode has come back into fashion. What's old becomes what's new again.

How to Enable Dark Theme in SSMS

Before we configure SSMS for Dark Mode, we need to note that it's not something officially supported by Microsoft at this time. Let's hope it is in the future.

The Dark Mode option has been available since SSMS 16, but is disabled by default.

First, let's open SSMS and look at the existing color schemes available.

  1. Tools
  2. Options…
SSMS Options
  1. Environment
  2. General
  3. Expand 'Color theme' dropdown
SSMS Color Theme

And we see the default of Blue, Blue (Extra Contrast), and Light.

  • Blue – default color scheme
  • Blue (Extra Contrast) - indistinguishable from Blue
  • Light – blue areas become grayish for very little contrast

We're going to be adding a fourth option to that list.

Close SSMS.

We're going to be making an edit to a file called ssms.pkgundef. Before we continue, let's look at what pkgundef files are. Pkgundef files are generated by Microsoft Visual Studio. They are used to remove features from an application by deleting specific registry keys. Essentially, when an application is started the feature is enabled then disabled. This is reason you'll see the reverse logic of enabling a feature by commenting it out.

Now, find the ssms.pkgundef configuration file. The following table has the default file location depending on your SSMS version.

SSMS Version Ssms.pkgundef File Location
16 C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio
17 C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio
18 C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE

Hopefully you've been keeping up with updates and are using at least SSMS 18 and will find the file in C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE. I'm using SSMS 18.11.1 which is the latest version as of the time of writing to write this tip.

Open the text editor of your choosing as Administrator. Running as Administrator will avoid permission problems when you save the file.

Text Editor
  1. Yes, if prompted by UAC
UAC
  1. Browse to folder containing ssms.pkgundef
  2. All Files
  3. Select ssms.pkgundef
  4. Open
Open ssms.pkgundef
  1. Scroll until you get to '// Remove Dark theme'
  2. Add '//' to the beginning of the '[$RootKey$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' line to comment it out
Edit File
  1. Save the file
Save File

Alternatively, you may prefer to run a script rather than manually editing the ssms.pkgundef file. The following PowerShell will search each of the three default SSMS install directories for ssms.pkgundef and will add the two forward slashes '//' in front of the '[$RootKey$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' line to comment it out. Remember to run it as Administrator.

# original script https://dba.stackexchange.com/questions/295714/changing-ssms-settings-via-powershell
 
# ssms 16
If (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef') 
{
   powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\ssms.pkgundef'"
}
# ssms 17
ElseIf (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef') 
{
   powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\ssms.pkgundef'"
}
# ssms 18
ElseIf (Test-Path 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef') 
{
   powershell -Command "(Get-Content 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef') -replace '\[\`$RootKey\`$\\Themes\\{1ded0138-47ce-435e-84ef-9ec1f439b749}\]', '//[`$RootKey`$\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}]' | Out-File 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ssms.pkgundef'"
}
Else {Write-Output 'ssms.pkgundef not found'} 
Editing ssms.pkgundef with PowerShell

Reopen SSMS and navigate to the 'Color theme' dropdown as we did earlier. Now, we will see a fourth option for Dark Mode.

Added Theme
  1. Select Dark
  2. OK
Choose Dark Mode

Here is what SSMS dark theme looks like now now:

SSMS Dark Mode

Unfortunately, it only changes the Ribbon and the Query Window. The Object Explorer and Results Grid aren't changed. But if you're primarily in the Query Window to write T-SQL scripts and stored procedures, you get this experience.

SSMS Dark Mode with Object Explorer Unpinned

Also, this change will be overwritten when you upgrade SSMS but as you've seen the change is easy to make.

You've likely configured Dark Mode in SSMS because you're a fan of it. But if you decide you don't like it it's a simple matter to change it to one of the other three options.

Next Steps


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Joe Gavin Joe Gavin is from the Greater Boston area. He started working with SQL Server and Sybase in 1998 in the financial services industry and has been a SQL Server Database Administrator for a dairy cooperative since 2011. He graduated from Northeastern University in Boston with a Bachelor of Science in Engineering Technology (BSET) degree in Computer Technology. Joe has spoken at the Boston and Providence SQL Saturday events.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips


Article Last Updated: 2022-04-18

Comments For This Article




Thursday, November 7, 2024 - 10:30:48 PM - Jake Back To Top (92621)
This works! Thanks a lot!
At least my eyes will have a rest from bright white light :)

Tuesday, March 26, 2024 - 5:52:46 AM - Doug Dekker Back To Top (92116)
SSMS 20.0 still not 64-bit and resides in the "C:\Program Files (x86)\Microsoft SQL Server Management Studio 20\Common7\IDE\" folder.

Monday, January 29, 2024 - 10:44:03 AM - Joe Gavin Back To Top (91890)
Thanks Denis. Maybe someday.

Monday, January 29, 2024 - 5:52:15 AM - Denis VANDERMEERSCH Back To Top (91889)
Hello,
Good tip! To be kept for further usage ;-)
Unfortunately, SSMS is not totally ready for dark mode, some parts are not parametrized to follow the modes' guidelines (Activity monitor, Object explorer, Registered servers and so on...)

Tuesday, October 24, 2023 - 6:33:25 PM - Vincent Back To Top (91703)
You are a genius, thank you for your help.

Thursday, September 14, 2023 - 4:12:19 PM - Admins Back To Top (91562)
Do a google search for "SQL Shades" This is 100% FREE and legit. I was a beta tester for it and it is a plugin to SSMS that will allow a much better support to a TRUE dark mode. No more jumping through hoops because MS is too damn lazy and refused to listen to their customers. This was at one point for years the top most requested item but the manager of SSMS was trying to force people onto AZURE which is crapola!

sqlshades.com

There is no charge for this the dev decided to keep it free for all to use.

Thursday, September 7, 2023 - 1:36:12 PM - parag Back To Top (91539)
Hello All,
In windows server 2019 , and windows server 2016 enable high contrast theme.(works for windows 8,10 and 11)
There are 4 themes , select any one.
Open SSMS.
Entire SSMS will be dark, Query window , left database pane and output window.
Very eazy, I have not tried for 2012.

Wednesday, May 17, 2023 - 6:19:25 AM - Amira Back To Top (91199)
Thank you so much sir..so helpful. Really.

Monday, March 13, 2023 - 8:40:21 PM - Jeff Moden Back To Top (91007)
I've finally figured out why a lot of Developers like the Dark Mode... Light attracts bugs. :D

Thursday, November 10, 2022 - 9:18:49 AM - DB Back To Top (90678)
They don't include dark mode so you'll switch to Azure Dev Studio, which I dislike. But I'm old.

Friday, September 2, 2022 - 10:39:21 AM - Joe Gavin Back To Top (90438)
Thanks for the comments Miguel. I love writing about simple things that are helpful.

Friday, September 2, 2022 - 5:59:03 AM - Miguel Cramer Back To Top (90435)
I just installed SSMS 19 on Preview and Dark theme looks great with your hack! Thank so much, Joe! I love working in dark theme, almost as much as I love simple hacks like this. For years I've struggled setting the entire PC on High Contrast, but that makes selecting and other views difficult. I've even gone through the wysiwyg fudge back in 1992, i.e. before Windows on DOS, and hated it. But everyone is still stuck on first gear on Lotus 1-2-3 for DOS. Even people that were not even born back then. You know, leaving margins on the left and top of an Excel Spreadsheet, agonising with the A1 notation when R1C1 makes more sense. It's like the story of "Mom, why do we have to cut the back end chicken to roast it?" Mom: "your great grandma said that's how's done. End of." It turns out great grandma only had a tiny roasting pan...

Monday, August 1, 2022 - 4:47:08 PM - Victoria Back To Top (90328)
Thanks : )

Tuesday, April 19, 2022 - 12:18:09 PM - Tony Back To Top (90019)
The colors of text and the background in the object explorer have no contrast between them it's hard to read the text. Also the results pane is not dark. The dark theme is pretty much useless. This looks like still a work in progress. Otherwise MS would have released it.

Monday, April 18, 2022 - 3:54:55 PM - Bryan Jenks Back To Top (90015)
What i dont get is why they wont just put in a dang darkmode yet, why make people edit this obscure file to access the darkmode >.>














get free sql tips
agree to terms