Tracking License Information in SQL 2005


SQL 2005 no longer tracks licensing (per seat or per processor) via registry entries. SQL 2005 still reads the registry for this information, but the SQL 2005 setup doesn’t put licensing information in the registry during setup as in SQL 2000.

 

This is by-design. Hence, when ServerProperty(‘LicenseType’) is run on a SQL 2005 installation, ‘DISABLED’ is always returned.

 

This could be a problem for large companies who would like a programmatic way to track licensing rather than just having paper license tracking (which is the current method in SQL 2005).


Supported Resolution

Since SQL 2005 still queries the registry for licensing information, add the following key and values and ServerProperty(‘LicenseType’) will return license information.

Note: Licensing has always been server wide and not SQL instance specific. This setting would apply to all instances of SQL Server on the server.

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server90MSSQLLicenseInfoMSSQL9.00

If you want to configure SQL Server for Per Processor then add these Registry Values under that Key adjusting for the number of processors you have a license for:

Name                          Type                           Value
Mode                      REG_DWORD            2          
ß LICENSE_MODE_PERPROC   
ConcurrentLimit        REG_DWORD            4          
ß Number of Processors

If you want to configure SQL Server for Per Seat licensing then add these Registry values under the Key adjusting for the number of seat license you have purchased.

 

Name                          Type                           Value
Mode                      REG_DWORD            0            
ß LICENSE_MODE_PERSEAT   
ConcurrentLimit        REG_DWORD            100        
ß No. of client licenses registered for SQL Server in Per Seat mode.

 

Test in SQL Management Studio

You need to stop and restart SQL Server 2005 before the information will be available to ServerProperty() as the registry is read on start-up of SQL Server. With the above settings you would see the following when you restart SQL Server 2005.

 

SELECT  ServerProperty(‘LicenseType’) as LicenseType, ServerProperty(‘NumLicenses’) as ProcessorCount

 

Output:
LicenseType             ProcessorCount

PER_PROCESSOR           4

Posted By:    Eric Burgess

 

Comments (20)

  1. Carl says:

    Hi! Does anyone have a solution for this now? I did not find any registry in the server. I have been checking other solutions for this but still unable to see my license details. Can anyone help me provide a solution? Thanks in advance.

  2. Chris says:

    I tried this on SQL Server 2012 and it works…

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server110MSSQLLicenseInfoMSSQL11.0

    Just remember to restart the SQL Server service prior to running the query.

  3. Hi,

    I've tried as Aamer said but still get DISABLED.

    B.T.W. SQL 2008 R2 64 Bit STD

    Here's what I did.

    created key MSSQLLicenseInfo inside HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server100 as it didn't exist (?should it already be there)

    created key MSSQL10.0 inside HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server100MSSQLLicenseInfo as it didn't exist (?should it already be there)

    Created keys inside HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server100MSSQLLicenseInfoMSSQL10.0

    Mode                      REG_DWORD            2

    ConcurrentLimit        REG_DWORD            1

    run the  query as above

    SELECT  ServerProperty('LicenseType') as LicenseType, ServerProperty('NumLicenses') as ProcessorCount

    DISABLED    Null

    Cheers in advance

  4. To get or track License Information on SQL 2008 you can use the following path.

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server100MSSQLLicenseInfoMSSQL10.0

    Registry name and values as mentioned above in this blog.      

  5. Dave says:

    It probably worked, maybe some typo in the regkey?

  6. Jay says:

    Dito..

    Same for me.. Can someone suggest a way around.

  7. Stefano says:

    Unfortunately creating those keys and value did not work in my case…the result is always "DISABLED".

  8. vimal says:

    i want to check wheter sql server 2005 is installed on my machine or not by checking its registry entry.so can u give me the exact registry entry for sql server 2k5 to be checked

  9. dmg says:

    I have sql 2005 installed with server 2003, I need to install sql on another server using server 2000. How do get the license key with out having the cd?

  10. Sameer says:

    I am trying to use this blog, but i did not found the following resgistry key on my server.

    HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server90MSSQLLicenseInfoMSSQL9.00

    Even if i manually created this , i cannot change the License Type…Please suggest

  11. Tam Kyle says:

    The info from ‘Hello’ above doesn’t provide a complete picture (from SQL server management studio anyway). Whilst it tells you the edition installed, eg Standard or Enterprise and the number of processors on the box running the software , it doesn’t tell you if the licensing mode is per-processor or per-user, or how many of whichever is active.

  12. Shawn says:

    Too bad SQL 2005 uses SSMS not enterprise manager, so your explanation doesn’t work.

  13. jb says:

    I’ve look in the properties and can’t find whether or not it is processor based or client based.  Can you detail how to find this information in the properties section?  Also, is there any way to query the information using Query ANalyzer or SQL-DMO/SQL-SMO?

  14. Jim says:

    I’ve checked the properties and can’t find where it displays whether it is processor or cal based license.  Can you please direct me where to look?

  15. Praveen Barath says:

    Amazing imformation !! heads off to you !!

  16. Mike P says:

    We had installed SQl Server 2005 in trial mode. In the meantime we bought a license. How would we enter the license so the server sees it and is able to restart. Currently is down.

    Thanks

  17. Hello says:

    Start SQL Server Enterprise Manager

    Then SQL Server Group

    Then RIGHT click on (local)

    Check Properties

  18. Bob Jones says:

    Hello there,

    your article is very helpful if I already have the License Mode information.  My question is how you would find the License Mode on a existing SQL 2005 server if you don’t already know it.

    Thanks.

    -BJ