How to get sql server license info

spock valucan 0 Reputation points
2023-12-19T16:55:17.8466667+00:00

I have a list of sql server deployed in different server and version in range from 11 to 19 and I need away to see when is the purchased license will expire? All these sql server are origination owned not personal use. Any help, please? It does not matter if its power shell script or through SSMS.

Here are what I have tried:
SELECT @@VERSION


SELECT SERVERPROPERTY('LicenseType') as Licensetype, 
       SERVERPROPERTY('NumLicenses') as LicenseNumber,
       SERVERPROPERTY('productversion') as Productverion, 
       SERVERPROPERTY ('productlevel')as ProductLevel, 
       SERVERPROPERTY ('edition') as SQLEdition,@@VERSION as SQLversion

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0206e532-efe9-40d9-a5db-e2f0b759030d/sql-server-license-key-checking?forum=sqltools

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,492 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 119.9K Reputation points MVP
    2023-12-19T22:32:35.6666667+00:00

    License information is not stored in SQL Server. The license is basically a piece of paper (electronic paper, one would like to hope). Your boss should know where you have this information, in case you get license-audited.

    SQL Server licenses never expires, so that is the least of your worries.


  2. Olaf Helper 46,301 Reputation points
    2023-12-20T08:13:33.8366667+00:00

    See SERVERPROPERTY (Transact-SQL) => E.g. LicenseType:

    "Unused. License information isn't preserved or maintained by the SQL Server product. Always returns DISABLED."


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.