13

I understand that there are three kinds of SQL licenses: http://www.microsoft.com/sqlserver/2005/en/us/pricing-licensing-faq.aspx

Is there a a dialog in SSMS, a sproc, registry key, etc I can look at on a server to determine the type and number of licenses?

Thanks

Booji Boy
  • 295
  • 2
  • 5
  • 11

3 Answers3

9

Found this entry, which recommends to run this, in Query Analyzer:

select serverproperty('LicenseType'),serverproperty('NumLicenses')

"If the above query returns DISABLED then locate this "sqlslic.cpl" file in SQL server folder(C:\Program Files\Microsoft SQL Server\80\Tools\Binn), Right Click-> Open with Control Panel. this will show you the licensing type used"

Also:

"DISABLED usually means you are using an MSDN copy of SQL Server (so, not a production license - MSDN licenses are meant for development and testing)."

  • I guess this only holds true for SQL Server 2000. SQL Server 2005+ don't maintain this info anymore see answer by VoteCoffee – Booji Boy Feb 09 '15 at 21:30
  • SELECT SERVERPROPERTY('LicenseType'), SERVERPROPERTY('NumLicenses'),SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') – Vishe Aug 26 '17 at 08:06
6

Per https://msdn.microsoft.com/en-us/library/ms174396.aspx:

LicenseType is Unused. License information is not preserved or maintained by the SQL Server product. Always returns DISABLED.

This is true for 2005+, so it does NOT mean that you are using an unlicensed version, contrary to the previous answer.

VoteCoffee
  • 176
  • 1
  • 3
  • Also, see this: http://blogs.msdn.com/b/sqlblog/archive/2006/11/10/tracking-license-information-in-sql-2005.aspx – VoteCoffee Feb 09 '15 at 20:42
  • So how do I find what the license is then? – binki Jan 08 '18 at 19:28
  • You wont be able to check any licensing information from inside sql server. If you are using SQL Server 2012 Enterprise and you don’t know if you are using the the core limited edition, just examine the SQL Server Error Log and you will see the information recorded there. A discovery report will let you see the installed version, but this is not necessarily the same as your license. https://blogs.msdn.microsoft.com/petersad/2009/11/12/sql-server-2008-discovery-report/ Basically, you have to go back to the paper license from what I have found. – VoteCoffee Jan 08 '18 at 20:34
4

I know this post is older, but haven't seen a solution that provides the actual information, so I want to share what I use for SQL Server 2012 and above. the link below leads to the screenshot showing the information.

First (let's break it down):

SQL Server 2000:

SELECT SERVERPROPERTY('LicenseType'), SERVERPROPERTY('NumLicenses')

SQL Server 2005+:

The "SELECT SERVERPROPERTY('LicenseType'), SERVERPROPERTY('NumLicenses')" is not in use anymore. You can see more details on MSFT documentation: https://docs.microsoft.com/en-us/sql/t-sql/functions/serverproperty-transact-sql?view=sql-server-2017

SQL Server 2005 - 2008R2 you would have to:

Using PowerShell: https://www.ryadel.com/en/sql-server-retrieve-product-key-from-an-existing-installation/

Using TSQL (you would need to know the registry key path off hand): https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-server-registry-transact-sql?view=sql-server-2017

SQL Server 2012+

Now, you can extract SQL Server Licensing information from the SQL Server Error Log, granted it may not be formatted the way you want, but the information is there and can be parsed, along with more descriptive information that you probably didn't expect.

EXEC sys.sp_readerrorlog @p1=0, @p2=1, @p3=N'licens'

Example output:

Example output from sys.sp_readerrorlog

Alex R
  • 972
  • 3
  • 12
  • 26
Josean
  • 141
  • 1