SQL Server: Finding out SQL Server product code from Windows registry

Hi All,

Do you really need to find out the Product Code of your SQL Server installation? You can use windows registry:

Navigate to

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

And look for key value ProductCode

1_Finding_out_SQL_Server_product_code_from_Windows_registry

Alternatively, you can use the undocumented stored procedure xp_regread, as follows:

   
USE master
GO
EXEC xp_regread 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup','ProductCode'
GO

Please note that all this is undocumented and unsupported so be careful when you browse the registry or use undocumented SPs. Play with your test installations only.

The registry path also depends on which version of SQL Server is installed and is it a fresh installation or an upgrade.

Hope you enjoyed reading this.

 

Regards

Rahul Sharma

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook

   

2 Comments on “SQL Server: Finding out SQL Server product code from Windows registry”

  1. This blog makes no sense. In SQL 2005 there is no screen which would ask the product code. The real PID concept was started in SQL 2008 onwards.

Leave a Reply

Your email address will not be published.