Installing SQL Server 2016 RTM? You must do this!
Arvind Shyamsundar, Lee Woods
Reviewed by Jeff Papiez, Mike Weiner, Troy Moen, Suresh Kandoth
It has been a while now since SQL Server 2016 has been generally available. We trust you are excited with the great capabilities that SQL Server 2016 brings to you, and have either already installed or will be installing it soon.
Critical Visual C++ Runtime Update
At this time, we want to remind you of a critical Microsoft Visual C++ 2013 runtime pre-requisite update that may be* required on machines where SQL Server 2016 will be, or has been, installed. Installing this, via either of the two methods described below, will update the Microsoft Visual C++ 2013 runtime to avoid a potential stability issue affecting SQL Server 2016 RTM.
* You can determine if an update is required on a machine via one of the two methods below:
- Select View Installed Updates in the Control Panel and check for the existence of either KB3164398 or KB3138367. If either is present, you already have the update installed and no further action is necessary.
- Check if the version of %SystemRoot%\system32\msvcr120.dll is 12.0.40649.5 or later. If it is, you already have the update installed and no further action is necessary. (To check the file version, open Windows Explorer, locate and then right-click the %SystemRoot%\system32\msvcr120.dll file, click Properties, and then click the Details tab.)
Obtaining the critical update
- The quickest and simplest method is to install the update provided by Visual Studio, KB3138367 - Update for Visual C++ 2013 and Visual C++ Redistributable Package. This will mitigate the potential SQL Server 2016 stability issue and negate the need for applying the alternative (and much larger) SQL Server 2016 update described below. Applying KB3138367 can be performed before, or after, SQL Server 2016 has been installed on a machine. KB3138367 is available on the Microsoft Download Center.
- You can alternatively choose to update the Microsoft Visual C++ 2013 runtime using an update provided by SQL Server, KB3164398 - Critical update for SQL Server 2016 MSVCRT prerequisites. KB3164398 is available via several channels as described in the KB article.
- The updated Visual C++ 2013 runtime binaries are also included in SQL Server 2016 RTM Cumulative Update #1 (CU1). You can optionally download CU1 rather than KB3164398 and utilize the UPDATESOURCE method described above to receive other valuable product updates also included in CU1 and subsequent CUs.
If you determine the update is required on a machine where SQL Server 2016 will be installed, and select to apply KB3164398 via method 2 above, you have the option to download the update and have it applied as part of the installation without internet connectivity present.
This blog post details the steps to integrate KB3164398 when you install SQL Server 2016 RTM installation on a computer with no access to the Internet (a.k.a. offline install.)
Step 1: Download, but do not execute, the KB3164398 update package
Download the correct file (SQLServer2016-KB3164398-x64.exe) from the Microsoft Download Center link mentioned in the KB article 3164398.
For example, let’s say that you downloaded the SQL installation media to C:\temp\SQL2016_GDR.
Step 2: Execute SQL Server 2016 RTM setup.exe from the command line and include the /UPDATESOURCE parameter
This step is where we ‘tell’ SQL 2016 RTM setup.exe to incorporate (slipstream) the now accessible KB3164398 update into the desired installation or upgrade without internet connectivity. To do this, we must use the /UPDATESOURCE parameter to RTM setup.exe from an administrative command prompt:
The important thing to note above is the /ACTION parameter. Failure to specify a valid action will cause the /UPDATESOURCE parameter to be ignored. Typical valid values for the /ACTION parameter include the following:
- Install (to install a new standalone instance of SQL Server 2016)
- Upgrade (to upgrade an existing instance to SQL Server 2016)
- InstallFailoverCluster (to install a failover clustered instance of SQL Server 2016)
The documentation page Install SQL Server 2016 from the Command Prompt has more details on these switches. Additionally, Installing Updates from the Command Prompt further details the UPDATESOURCE method of including updates in new installations or upgrades.
If this command line is correct, SQL Server 2016 Setup will detect the KB3164398 update and list it in the ‘Product Updates’ screen as shown below:
In subsequent screens, you will see the ‘Extract Setup files’ step below will have an ‘In Progress’ status. That means that the update package is being extracted and will be installed.
Skipping forward to the last ‘Ready to Install’ screen, you will observe that the ‘Product Update’ section (as highlighted in the below screenshot) has the properties as below.
Step 3: Validate the version of the Visual C++ 2013 runtime loaded by SQL Server 2016
To validate that the correct version of the VC++ runtime has now been installed and loaded, execute the following query using SQL Server Management Studio or SQLCMD:
SELECT name, file_version FROM sys.dm_os_loaded_modules WHERE name like '%msvcr120.dll%'
The version should be 12.0:40649.5. If that checks out, then you are good to go! If it does not, you are most likely missing a reboot. Did you skip that reboot when prompted by setup?
Step 4: Validate the update has been applied
You may also validate successful installation of the update in the new instance by executing:
Given the various options described above, please note the following:
- If you had simply installed KB3138367 (Method 1 described in the 'Obtaining the critical update' section), then the version number for SQL Server will remain at 13.0.1601.5.
- If you followed Method 2, the output of SELECT @@VERSION will be as shown below. Notice the RTM-GDR keyword, which tells you that the GDR update has been applied:
Microsoft SQL Server 2016 (RTM-GDR) (KB3164398) - 13.0.1708.0 (X64)
- If you followed Method 3 and used CU1, the output of SELECT @@VERSION would return the below. The RTM-CU1 clearly indicates that the SQL engine has been updated to CU1.
Microsoft SQL Server 2016 (RTM-CU1) (KB3164674) - 13.0.2149.0 (X64)
We hope these steps clarify the method of integrating the critical update for Microsoft Visual C++ runtime with SQL Server 2016 setup. In case of any questions, please leave your Comments below!