How to Find Microsoft SQL Server Product Key

Atif Zaheer | Jul 06,2022 8 min read


Microsoft SQL Server also requires an activation key to function fully. Now, you might be thinking why Microsoft SQL server requires a product key? Well, like other platforms, it also requires a product key for verification purposes.

Usually, the Microsoft SQL product key is embedded within the setup wizard. Therefore, it can be a tough ask to extract this key. Here are some reasons why you might need the Microsoft SQL product key:

  • Lost The Service Key
  • Relocating The Server
  • Want To Install Microsoft SQL on Another System

So, these are scenarios where you need the Microsoft SQL service key. Now, how to find it? Well, no worries. In this article, we will share some of the best ways to find the Microsoft SQL Server product key smoothly.

Top 3 Tools to Find SQL Server Product Key


In this section, we will be taking help from some popular tools such as EaseUS Key finder. It is undoubtedly one of the best tools for finding lost or forgotten product keys. Further, we will also be sharing some not-so-common tools and methods for finding the Microsoft SQL Server product key. So, let us start the discussion.

1: EaseUS Key Finder [The Easiest Tool]

We cannot forget EaseUS whenever we talk about recovering the Microsoft SQL product key. This is because this specific tool is an excellent way to find out lost or forgotten product keys. It lets you do much more than a typical tool. 

Visit Site

Price: It starts $19.95/Monthly.

Compatibility: Windows 11/10/8.1/8/7/Server

 Buy Now $9.95$19.95

30-day money back guarantee

How to use:

Step 1: Download EaseUS (If you haven't already) and launch it.

Step 2: Click on the "Application" tab that lies under the "Registry Key."


Step 3: On the right panel of Applications Registry Keys, EaseUS Key Finder will list the product keys of all the installed software on your system. You just have to select the serial numbers that you want to recover. Also, you can simply copy the product key or save and print it as per your needs.


2. Windows Registry [Free]

When Windows registry works with Microsoft SQL, you know you can easily recover its product key. This method is free and involves some simple steps.


  • No third-party software required
  • Helps find product keys with ease


  • The process can be a bit technical for some

How to use:

Step 1: Go to the windows search bar located at the right section of the taskbar.

Step 2: To open the registry, type "regedit" in the search bar.


Step 3: Navigate to the path and locate the product code value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup

Step 4: Now, double-click the product code value to view the SQL product key.

Verdict : So, finding the Microsoft SQL product key using the Windows registry is not just free. It also has detailed steps to follow. However, if you are not a tech guy, you may opt for EaseUS Key Finder. 

3. PowerShell [Free and for Advanced Users]

With the help of PowerShell, you can also find the Microsoft SQL key. This method is also free and works pretty well. The only downside here is that it is recommended for advanced users. However, we have explained the whole method with easy-to-follow steps. So, you can get an idea about the whole process.


  • Free
  • Gets the job done


  • Beginners may have a hard time using this method

How to use:

Step 1:  Launch a PowerShell prompt by going to Start > Run. After that, type powershell and hit ENTER.

Step 2:  Simply paste the command below inside the prompt area and press ENTER.

function GetSqlServerProductKey {
    ## function to retrieve the license key of a SQL 2008 Server.
    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 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

This script can work seamlessly with SQL Server 2005, 2008 and 2008 R2. Still, you'll need to modify this code if you are on Sql Server 2012 or Sql Server 2014.
  • For Sql Server 2012, you'll have to replace two lines of code:

1. Replace line 5 with $regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\Setup"

2. Replace line 16 with $binArray = ($data.uValue)[0..16]

  • For Sql Server 2014, you'll have to replace line 5 with the code of $regPath = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.[YOUR SQL INSTANCE NAME]\Setup" (You'll need to change some codes based on your installation.)

Step 3: Now, type "GetSqlServerProductKey" and tap ENTER. With that, the system will display the product key smoothly.



So, now you should know how to find your Microsoft sql server product key. Among the three methods we mentioned above, EaseUS Key Finder is definitely the most straightforward one. It can assist you in recovering your Microsoft sql server product key in a few clicks without any confusing steps. 

You can also try Windows Registry and PowerShell to get back your product key, yet these two ways come with more complex steps and are more suitable for tech guys.

Again, it all depends on you. However, we do recommend EaseUS Key Finder if you want to avoid any hustle.

Visit Site

Price: It starts $19.95/Monthly.

Compatibility: Windows 11/10/8.1/8/7/Server

 Buy Now $9.95$19.95

30-day money back guarantee

No more content

Related articles