This page is focused on providing professional and effective solutions to help you locate or retrieve the missing or product key for Microsoft SQL Server. Please follow the guidance to find your Microsoft SQL Server product key.
Yes, Microsoft SQL Server does have product keys. However, unlike Windows operating systems or Office applications, SQL license keys are embedded within the software activation wizard.
Therefore, you will not find the license information directly in the Management Console. Where can you find the SQL product key after installation?
Read on, and we'll discuss this further, making it easy for you to find the license you need for SQL Server 2019/2017/2016 or even older versions.
Before writing this guide, we searched online and found that most of the available solutions for finding your Microsoft SQL Server product key were poorly explained.
Here, we've gathered 3 practical methods and described in detail how to retrieve SQL Server license information:
#1. Use a One-Click SQL Server Product Key Finder Tool
#2. Use the Registry
#3. Use PowerShell
Applies to: SQL Server 2019/2017/2016/2014/2012/2008 R2/2008/2003/2000, etc.
Quick Guide:
Now, we begin looking for the SQL Server product key in the Windows Server computer.
"Search for Microsoft SQL Server product key with one click"
The Key Finder tool enables all levels of Microsoft SQL Server, Windows Server and Windows users to easily find product keys for installed operating systems, software and applications with a simple click.
In addition to retrieving SQL Server keys, this software can be used for:
How to find the product key for Microsoft SQL Server:
Click the "Applications" tab under "Registry Items."
Step 2. The registration codes for the programs will be displayed on the right. KeyFinder will show you the keys of all your installed software. Copy the serial number you want, or click on "Print" or "Save".
Does your company need to back up all files, settings, applications, and configuration files from Windows Server 2019, 2016, or 2012 (R2)? Read on to learn how to back up to AWS or an on-premises server.
Solutions to Find SQL Server Product Key for Free (UTF-8 Encoded)
The Registry Editor on a Windows Server computer can also help you find the SQL Server product key. Exercise caution as you browse the Registry Editor to look for the SQL Server key value by following these steps:
Note that the registry path might vary, depending on the version of SQL Server that you are using.
Step 1: Right-click the Windows icon and select “Search.”
Step 2: Type regedit and press Enter to open the Registry Editor.
Step 3: Browse to the path and locate the ProductCode value:
This text refers to a path in the Windows Registry, which in American English would be the same: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup 请注意,这是Windows注册表中的一个特定位置,存放着与微软SQL Server相关的设置和配置信息。在英文系统中,这个路径保持不变,因为注册表键名通常不会翻译。
Step 4: Double-click the ProductCode value to display the SQL Server key.
Command Line Solution to Find SQL Server Keys
This utility retrieves the product key from an existing installation of SQL Server on a client or server computer. This is useful when you need to migrate or move an old server, but nobody can remember where the license is.
Here are the steps to find your SQL Server product key using PowerShell, with the encoding format set to utf-8:
Step 1: Right-click the Windows icon and select “PowerShell.”
Step 2. Type the following command in PowerShell and press Enter:
function GetSqlServerProductKey {
# This function retrieves the license key for SQL Server 2008.
param ($targets = ".")
$hklm = 2147483650
$regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Setup"
$regValue1 = "DigitalProductId"
$regValue2 = "PatchLevel"
$regValue3 = "Edition"
Foreach ($target in $targets) {
$productKey = $null
$win32os = $null
$wmi = [WMIClass]"\\$target\root\default:stdRegProv"
$data = $wmi.GetBinaryValue($hklm,$regPath,$regValue1)
[string]$SQLver = $wmi.GetstringValue($hklm,$regPath,$regValue2).svalue
[string]$SQLedition = $wmi.GetstringValue($hklm,$regPath,$regValue3).svalue
$binArray = ($data.uValue)[52..66]
$charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"
# Decrypt the base24 encoded binary data
For ($i = 24; $i -ge 0; $i--) {
$k = 0
For ($j = 14; $j -ge 0; $j--) {
$k = $k * 256 -bxor $binArray[$j]
$binArray[$j] = [math]::truncate($k / 24)
$k = $k % 24
}
$productKey = $charsArray[$k] + $productKey
If (($i % 5 -eq 0) -and ($i -ne 0)) {
$productKey = "-" + $productKey
}
}
$win32os = Get-WmiObject Win32_OperatingSystem -computer $target
$obj = New-Object Object
$obj | Add-Member NoteProperty Computer -value $target
$obj | Add-Member NoteProperty OSCaption -value $win32os.Caption
$obj | Add-Member NoteProperty OSArch -value $win32os.OSArchitecture
$obj | Add-Member NoteProperty SQLver -value $SQLver
$obj | Add-Member NoteProperty SQLedition -value $SQLedition
$obj | Add-Member NoteProperty ProductKey -value $productkey
$obj
}
}
#1. For SQL Server 2012, replace lines 5 and 16 with the following:
#2. For SQL Server 2014, replace DigitalProductID with the actual instance name in the registry, and replace line 5 with the following:
3. Type GetSqlServerProductKey, and then press Enter.
After that, you will see your SQL Server product key in the PowerShell window.
In many cases, it is crucial to find the SQL Server product key. On this page, we have gathered 3 reliable methods for you to follow and retrieve your lost SQL Server product code.