Category: Database

DatabaseProductivity

How to Enable Dark Theme for SQL Server Management Studio

Updated Feb. 21, 2018 – Each time you install a newer version of SSMS, like 17.5 that released last week, you will need to go and update the configuration file and comment out the Dark theme references as described below.

If you’re like me and you like to use the Visual Studio Dark theme and wish you could use this theme for SQL Server Management Studio (SSMS), unfortunately, there is no official support at this time (keep bugging Microsoft for this feature please). Currently SSMS 2016 and SSMS 17 support both the Blue and Light themes.

If you weren’t aware, SQL Server Management Studio is built on the Visual Studio shell, so it does support the Dark theme but it’s currently disabled due to “unfinished work” with various parts of the application like the Object Explorer and Output panes.

Here is my current SSMS 17 using the Light theme:

image

To enable the Dark theme follow these simple steps

1. Close down all running instances of SSMS

2. Open Windows Explorer and browse to the following location to change the configuration file ssms.pkgundef

    • For SSMS 2016: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio
    • For SSMS 17: C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio

3. Type the name of the file into the search box at the top right corner and then right click to edit this file. Note: You will need to edit this file with Administrative rights.

image

4. Now search the file for the following line // Remove Dark Theme and then comment out each line in this section by using // at the start of each line in this section as shown below:

image

5. Save the file and now re-launch SSMS. After restarting SSMS, go to Options you will see the Dark them listed. Select the Dark theme and then press the OK button.

image

Your SSMS should now be using the Dark theme, similar to what my SSMS looks like now after enabling this theme. Ah this is much better!

image

For the most part its dark but where it fails is in the Object Explorer and Output panes as you can see here:

image

There is a way to go into Options and tweak the colors for the Output pane (results grid and messages), but that is extremely tedious and not worth the effort in my opinion.

Alternate Solutions

Now I’m not sure why this is not fully supported yet, especially for the Object Explorer and the Output panes. People keep asking for this feature and release after release it’s still not properly supported.

Now if you look at Visual Studio, there is a SQL Server Object Explorer and when you run a query, the results window (text and grid) supprt support the dark theme as shown below. So this is an alternate method if you don’t want to change SSMS.

image

For those of you that are not developers and use SSMS for interacting with your SQL Servers and want to use a dark theme editor, you can install a bare bones instance of Visual Studio 2017 with just the database tooling by selecting the Data storage and processing workload.

image

Summary

Hopefully, a future update to SSMS will enable the Dark theme out of the box and until then this is a temporary solution that may or may not work for you. For me, I spend most of my time working with SQL queries that I don’t need Output or Object Explorer visible, so I just collapse them.

This method works for both SSMS 2016 and SSMS 17.

Enjoy!

References

https://www.sqlshack.com/setting-up-the-dark-theme-in-sql-server-management-studio/

Database

Free ebook – SQL Server Internals: In-Memory OLTP, Inside the SQL Server 2016 Hekaton Engine

SQL Server Internals: In-Memory OLTP eBook cover

A new free ebook by Kalen Delaney on the internals of SQL Server 2016 In-Memory OLTP has been published by Simple Talk (redgate), which introduces and explains how SQL Server 2016 In-Memory OLTP engine (a.k.a. Hekaton) works. This book goes into detail about the in-memory engine and will help you with migrate existing databases and tables over to Hekaton for beyond imaginable performance.

“The SQL Server 2016 In-Memory OLTP engine (a.k.a. Hekaton) is designed to exploit terabytes of available memory and high numbers of processing cores. It allows us to work with memory-optimized tables and indexes, and natively compiled stored procedures, in addition to the disk-based tables and indexes, and T-SQL stored procedures, that SQL Server has always provided.”

Working with Hekaton in-memory data is very accessible using T-SQL and SSMS. However there are some limitations and this book goes into detail about what’s possible and what’s not and how to get around the issues.

Download your the free ebook here.

Enjoy!

References

https://www.red-gate.com/simple-talk/books/sql-books/sql-server-internals-in-memory-oltp/

https://www.microsoft.com/en-us/sql-server/sql-server-2016

Database

An Update to SQL Server Management Studio is Available

image

This week we see an update for SQL Server Management Studio, version 17.2. This release is the latest generation of SQL Server Management Studio and provides support for SQL Server 2017.

image

What’s New in this Release

  • Multi-Factor Authentication (MFA)
  • The connection dialog box now supports the following 5 authentication methods:
    • Windows Authentication
    • SQL Server Authentication
    • Active Directory – Universal with MFA support
    • Active Directory – Password
    • Active Directory – Integrated
  • Database import/export for DacFx wizard can now use Universal Authentication with MFA
  • ADAL managed library used by Azure AD Universal Authentication with MFA was upgraded to version 3.13.9
  • A new CLI interface supporting Azure AD admin setting for SQL Database and SQL Data Warehouse
  • Output window has entries for queries run during expansion of Object Explorer nodes
  • Enabled View designer for Azure SQL Databases
  • Changes to the default scripting options for scripting objects from Object Explorer in SSMS
  • Added support for National Clouds in "Restore from URL"
  • QueryStoreUI reports now supports additional metrics (RowCount, DOP, CLR Time etc.) from sys.query_store_runtime_stats
  • IntelliSense is now supported for Azure SQL Database
  • Security: connection dialog will default to not trusting server certificates and to requesting encryption for Azure SQL Database connections
  • General improvements around support for SQL Server on Linux
  • Performance Dashboard server report now available as a default report
  • Showplan node search allows searching in plan properties. Easily look for any operator property such as table name

For the full list of changes, see SQL Server Management Studio – Changelog (SSMS).

Getting the Update

Head over to https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms and you will find two links for installation. The first links downloads and installs SSMS 17.2 where as the second link will update an existing 17.x installation.

This update will not upgrade or replace SSMS versions 16.x or earlier. SSMS 17.x will install side by side with previous versions. If you have multiple SSMS versions installed than the latest is labeled as Microsoft SQL Server Management Studio 17 and has the following icon:

image

Starting the Installation

Installation is quick and easy…

sshot-8

sshot-9

sshot-11

After the installation is complete, when you open up SSMS 17.2 and look at the About dialog you will see the following components updated:

image

Sadly we still don’t have an official Dark theme for SQL Server Management Studio. I recall reading comments from the SQL team last year that they needed to do work on all the dialogs before releasing this theme. If the base SSMS IDE supports the Dark theme than just release it You can work on the dialogs as needed and provide them in future updates.

Enjoy!

References

Download SQL Server Management Studio (SSMS)

SQL Server Management Studio – Changelog (SSMS)

DatabaseDevelopment

SQL Server Management Studio 17.0

There is a new release of SQL Server Management Studio (SSMS) now available – version 17.0. It feels like yesterday when SSMS 16 was released (June 2016). I’m not going to complain as it’s refreshing to see such the constant updates to SSMS now that it’s not tied in with the database engine installer.

To get the latest version, head to the download page and install the web-installer. SSMS 17 will install side-by side with previous versions of SSMS.

This latest release includes a lot of new functionality, namely with support for connecting to SQL Server on Linux. Please see the full SSMS changelog for a complete listing of enhancements and bug fixes. Sadly this release still doesn’t support the Dark theme. Hopefully this is something they add in a future release.

Installing SSMS 17:

sshot-280

Updated splash screen:

image

SSMS 17 icons have been updated to be consistent with VS Shell provided icons and support High DPI resolutions:

sshot-284

One of the nice additions to this release is the inclusion of “Presentation Mode”. There are 3 new tasks available via the Quick Launch (Ctr-Q):

  • PresentOn – Turns on presentation mode where the editor and environment fonts are larger
  • PresentEdit – Allows you to edit the presentation font sizes
  • RestoreDefaultFonts – Reverts back to the default settings

If you  are familiar with these commands in Visual Studio then you will  notice that there is currently no PresentOff command. Use RestoreDefaultFonts to turn off Presentation Mode.

Enjoy!

References

Download SSMS
Download SQL Server Data Tools (SSDT)
SSMS Changelog
SSMS Release Notes

AzureDatabase

Azure SQL Database DTU Calculator

When considering an Azure SQL instance, one of the decisions you need to make is the pricing level (Basic, Standard or Premium) and then for the selected level the number of DTU’s you need. Now you might be asking, "which service tier and performance level should I use and how many database throughput units (DTUs) am I using now?" 

First lets look at explaining what a DTU is and then we can look at how the DTU Calculator will help.

What are Database Transaction Units (DTUs)?

“A DTU is a unit of measure of the resources that are guaranteed to be available to a standalone Azure SQL database at a specific performance level within a standalone database service tier. A DTU is a blended measure of CPU, memory, and data I/O and transaction log I/O in a ratio determined by an OLTP benchmark workload designed to be typical of real-world OLTP workloads. Doubling the DTUs by increasing the performance level of a database equates to doubling the set of resource available to that database.”

How can I determine the number of DTUs needed by my workload?

If you are looking to migrate an existing on-premises or SQL Server virtual machine workload to Azure SQL Database, you can use the DTU Calculator to approximate the number of DTUs needed.

Following the instructions for the DTU Calculator, download either the Command Line Utility or PowerShell Script and run it to measure your server resource utilization. You want to get an hour worth of data.

Once the script completes, go to the DTU Calculator website and enter in the number of cores for your server and then upload the CSV file that was generated. Then click on the “calculate” button as show below.

image

After the DTU Calculator measures your server resource utilization, it will provide you the best recommendation for the number of DTU’s you should be using in Azure SQL.

Resources

DatabaseDevelopment

SQL Server Management Studio 2016: Quick Overview

It’s been almost two months since SQL Server 2016 was released and today I’ll provide a quick overview of some of the benefits new with SQL Server Management Studio 2016 or also known as SSMS 2016.

New Installer

One of the first things I noticed when I installed SQL Server 2016 is that SSMS is no longer listed in the features for installation. This is because SQL Server Management Studio 2016 has become its own stand-alone installer that can easily be downloaded from the web. There is also a link in the SQL Server engine management tools which takes you to the web to download the separate installer for SSMS 2016.

By decoupling SSMS from the roughly two-year release cycle of the core product, the SSMS team is able to provide quicker releases for SSMS. In the two months since it’s released we’ve already seen two updates. From what I’ve read it looks like they’re on a monthly cadence – which is awesome!

sshot-301

Visual Studio Awesomeness

sshot-1

SSMS 2016 is now built upon the Visual Studio 2015 shell and unlike SSMS 2012 and SSMS 2014 that were based on Visual Studio 2010 this brings a number of improvements:

Performance

Now that SSMS 2016 is build upon the Visual Studio 2015 shell, it gets all the performance optimizations that came in versions of Visual Studio since Visual Studio  2010. This is something you’ll notice immediately when running SSMS 2016.

I don’t know why SSMS 2012 and SSMS 2014 weren’t updated to be based on the latest Visual Studio at the time. I guess timing was a factor and priority was probably put on the database engine and not the editor. Hopefully now that SSMS is decoupled from the database engine release cycle we will see SSMS be updated and based on newer versions of Visual Studio as they become available. 

Support for High-Resolution Displays

Anyone that is using a Microsoft Surface Pro or Surface Book will know the DPI issues that plagued previous versions of SSMS. SSMS 2016 finally provides first-class support for high-resolution displays. 

Removed dependency on .NET Framework 3.5

It’s always good to let go of dependencies on older frameworks like .NET Framework 3.5.

Automatic Updates

SSMS 2016 now automatically checks for updates on start-up and also provides a toast notifications within SSMS when a new release becomes available.

You also have the chance to manually check for updates rom the Tools menu as shown here:

check-for-updates

check-for-updates-dialog

Support for Themes

SSMS 2016 now comes with an additional them called Light. Any developer of Visual Studio will already recognize this theme and it’s a welcome addition. From what I’ve read online, the SSMS team is working on bringing a Dark theme to SSMS. Not sure when a Dark theme will be released but lets hope sooner than later. Everything just seems to run and look better in the Dark them.

themes

New Quick Launch and Find Dialogs

Another feature that comes with the Visual Studio 2015 shell is the new quick find dialog located in the upper right corner of the editor. SSMS 2016 also has the Quick Launch which is in the upper right corner of the window and allows you to quickly search for options, etc.

sshot-3

SSMS Azure Integration

The Table Designer is enabled for supporting Azure for SQL Database v12. The Database and Properties dialogs also work with Azure SQL Database v12.

Import and Export wizards also support Azure Database service tiers.

Next Steps

Download SSMS 2016: https://msdn.microsoft.com/en-us/library/mt238290.aspx
Download SQL Server Data Tools (SSDT) https://msdn.microsoft.com/en-us/library/mt204009.aspx
Download new World-Wide Importers sample database

DatabaseDevelopment

Including Data in a SQL Server Database Project

The other day I found myself looking at how I can include reference data in a new database as part of my SQL Server Database Project. Typically for my existing databases, I’ve just create post-deployment scripts to add/update/delete reference data as needed with each release. However with my new database, I have a number of tables and rows in each that I’ll need to deploy the first time.

The first option that comes to mind would be that I can do this as per usual and create a v1.0 script to populate the data, but I thought there should be a better way to maintain and deploy this data. What if it ever changes and I need it updated? I’ll then have to script specific post-deployment scripts. Not ideal.

I did a little searching and came across this old post on the SQL Server Data Tools Team Blog for Including Data in SQL Server Database Projects. This seems like a great option, but I already see there are a number of people complaining that this isn’t good enough and I would agree. I also have the added annoyance that I’m still stuck using SQL Server 2005, so the MERGE option isn’t even an option for me.

Further research shows another post on how to Mimic MERGE with the OUTPUT statement in SQL Server 2005. This looks like it will work for SQL Server 2005, but makes things more complex in my opinion. I really just want to declare in my database project the values the table should have on deployment and then let the build and deployment process determine what needs to be done.

I think for now I’ll stick with my first option and create an initial v1.0 post-deployment script. I’ll then take a look at what comes in Visual Studio 2013 later this year and if there are new options for addressing this issue.

We are moving to SQL Server 2012 by year end, so I can at least migrate to doing the MERGE approach at that time if there is nothing else available.

I hope this helps others in the same situation.

Enjoy!