How do I find out what License has been applied to my SQL Server installation?
I have SQL Server 2008 installed, but I'm not sure what license was installed. Is th开发者_运维知识库ere an easy way to find this out?
I presume you mean via SSMS?
For a SQL Server Instance:
SELECT SERVERPROPERTY('productversion'),
SERVERPROPERTY ('productlevel'),
SERVERPROPERTY ('edition')
For a SQL Server Installation:
Select @@Version
This shows the licence type and number of licences:
SELECT SERVERPROPERTY('LicenseType'), SERVERPROPERTY('NumLicenses')
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 (so no time is wasted):
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://learn.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://learn.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 sp_readerrorlog @p1 = 0
,@p2 = 1
,@p3 = N'licensing'
NOTE: I tried pasting the image directly, but since I am new at stakoverflow we have to follow the link below.
SQL Server License information via sp_readerrorlog
SELECT SERVERPROPERTY('LicenseType') as Licensetype,
SERVERPROPERTY('NumLicenses') as LicenseNumber,
SERVERPROPERTY('productversion') as Productverion,
SERVERPROPERTY ('productlevel')as ProductLevel,
SERVERPROPERTY ('edition') as SQLEdition,@@VERSION as SQLversion
I had installed evaluation edition.Refer screenshot
When I run:
exec sp_readerrorlog @p1 = 0
,@p2 = 1
,@p3 = N'licensing'
I get:
SQL Server detected 2 sockets with 21 cores per socket and 21 logical processors per socket, 42 total logical processors; using 20 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
also, SELECT @@VERSION shows:
Microsoft SQL Server 2014 (SP1-GDR) (KB4019091) - 12.0.4237.0 (X64) Jul 5 2017 22:03:42 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)
This is a VM
SQL Server does not track licensing. Customers are responsible for tracking the assignment of licenses to servers, following the rules in the Licensing Guide.
精彩评论