Finding the CD Key

Looking for an installed SQL Server's CD key from the Windows registry? Here are some ways to find it...

Brian Moran

May 19, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

Can I find an installed SQL Server's CD key from the Windows registry? I have the software, but I've misplaced the key.

See also, "Transferring SQL Server Registration Information Between Machines" and "Manipulating the Registry."

Specific paths to registry keys vary based on how you've installed and upgraded SQL Server. In my registry, the CD key is at the following registry path:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server80registrationCD_KEY

On your machine, the CD key should be in the same registry key or one similar to it.

Alternatively, you could use the undocumented xp_regread extended stored procedure and read the value directly, as this example syntax shows:

USE masterEXEC xp_regread 'HKEY_LOCAL_MACHINE',                'SOFTWAREMicrosoftMicrosoft SQL                  Server80registration',                'CD_KEY'

The first parameter specifies the root key in the registry. The second parameter is the path to the key. The third parameter specifies the key value that you're looking for. Note that you should be wary of using xp_regread in an application because it's an undocumented function that Microsoft can remove without warning. However, using the extended stored procedure for ad hoc access is perfectly safe.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like