About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Error 17051 means the instance is an Evaluation edition and its trial period has ended. Microsoft's error list gives the text as "SQL Server evaluation period has expired." at severity 16. The Evaluation edition carries all Enterprise functionality for a limited time, and it does not turn into a paid edition by itself.
What you can do depends on whether the service still starts. If it starts, run Edition Upgrade from SQL Server Setup with a product key for the edition you hold. If it will not start, Microsoft's expired-evaluation page documents one route, which is a new Express instance with your data files attached, and only for databases under 10 GB.
What the error means
Microsoft's editions page for SQL Server 2022 says Evaluation edition "includes all the functionality of Enterprise edition" and that "an evaluation deployment is available for 180 days." Microsoft's expired-evaluation page describes the result as an expired edition that "can't" be started. The error list records 17051 as an event that is logged, so the line appears in the errorlog.
Tools can fail separately. Microsoft's expired-evaluation page lists a tools message: "Evaluation period has expired. For information on how to upgrade your evaluation software please go to https://www.microsoft.com/sql/howtobuy." It says this "also applies to scenarios wherein only tools are installed from an evaluation version", such as SSMS or SQL Profiler installed from evaluation media on a machine whose engine is licensed.
The same page shows a second symptom when you try to connect to an expired instance: "A network-related or instance-specific error occurred while establishing a connection to SQL Server" with Named Pipes error 40. Microsoft notes that this message "is a generic message, and it's not always tied to an expired installation." Do not conclude from error 40 alone that the trial has ended; read the errorlog.
That page was written for SQL Server 2008 to 2014. The supported edition upgrade paths for current versions are on a separate page, and Setup's Edition Upgrade is documented in a third.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Evaluation instance past its 180 days | Service stops or refuses to start; errorlog has error 17051 | SERVERPROPERTY('Edition') shows an Evaluation edition while the instance runs; errorlog line when it does not |
| Only the tools are from evaluation media | The message appears in SSMS or Profiler, the engine is licensed | Compare the engine edition with the tools install |
| A clustered Evaluation instance | Edition Upgrade is not available to you | Microsoft's page lists Evaluation to a paid edition as not supported for clustered installations |
| Expired instance that cannot start | Setup cannot upgrade it, connections fail with error 40 | Service status in Services; the 17051 line in ERRORLOG |
Prove the cause before changing anything
Check the service state first. If it runs, connect and read the edition. Microsoft documents SERVERPROPERTY('Edition') as "Installed product edition of the instance of SQL Server", with 64-bit builds appending "(64-bit)". The EditionID table lists "Enterprise Evaluation" as one value.
SELECT SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('EditionID') AS EditionID,
SERVERPROPERTY('ProductVersion') AS ProductVersion;
If the service will not start, read the ERRORLOG file in the instance's Log folder and look for "evaluation period has expired". With the instance running, EXECUTE sp_readerrorlog 0, 1, 'evaluation'; filters the current log on that word, and Microsoft documents @p3 as the filter string.
Then check whether the instance is clustered with SELECT SERVERPROPERTY('IsClustered');, which only reads. Microsoft's upgrade-path page states that moving from Evaluation to any paid edition "is supported for stand-alone installations, but isn't supported for clustered installations", and that the limit does not apply to stand-alone instances on a Windows Server failover cluster that take part in an availability group.
Finally, confirm you hold a licence for the edition you will move to. Setup's Product Key page asks whether you are upgrading to a free edition or whether "you have a PID key for a production version of the product."
Fix
Instance starts, stand-alone. Run Setup as an administrator. In the SQL Server Installation Center select Maintenance, then Edition Upgrade. On the Product Key page enter the PID key for the production edition. On the License Terms page accept the terms, then pick the instance, read the Edition Upgrade Rules page, and select Upgrade.
Disruptive step: Microsoft states that "Setup must restart SQL Server services" for the edition change to take effect, which "results in application down time while services are offline." Schedule a window and tell users. There is no in-place way back. Microsoft's way to move down an edition is a full uninstall and reinstall using the system databases you moved aside, as described on the same page.
Microsoft documents a command-line form for a case where the Setup rule Engine_SqlEngineHealthCheck fails:
setup.exe /q /ACTION=editionupgrade /InstanceName=MSSQLSERVER /PID=<appropriatePid> /SkipRules=Engine_SqlEngineHealthCheck
Risk: /SkipRules switches off a health check that Setup would otherwise enforce. Use it only when that one rule is the reported blocker, and record why. There is no undo for skipping a rule; the check simply did not run.
Clustered Evaluation instance. The documented edition upgrade does not apply. Do not try to force it. Either raise a case with Microsoft support or plan a new licensed instance and move the databases to it. Microsoft's expired-evaluation page describes detach and attach for the move to Express.
Only the tools expired. Microsoft says to apply the same Edition Upgrade guidance to the tools, or to reinstall the tools from non-evaluation media.
Instance will not start. Microsoft's expired-evaluation page, for an Enterprise evaluation, gives these steps when the database is under 10 GB: install an Express edition, locate the .mdf and .ldf files, and attach them to the Express instance. Where the files sit in the old instance's default data directory, the page suggests moving them first to the new instance's data directory or another location.
Risk: attaching to Express applies Express limits. Microsoft states the maximum relational database size for Express is 10 GB. Copy the data and log files to a safe location before you touch them, so the originals remain. The page covers user databases only. Logins, Agent jobs and other instance-level objects live in master and msdb, and the page does not describe carrying them across.
Microsoft's pages on this subject do not say whether Setup's Edition Upgrade can run against an expired instance whose service will not start. Do not assume it can. If you need a licensed edition rather than Express, or the databases are over 10 GB, raise a case with Microsoft support before uninstalling anything.
Example (illustrative): sql01 was installed from evaluation media on 4 April and runs the Sales database. Counting 180 days forward from 4 April gives 1 October: 26 days to 30 April, then 31 in May, 30 in June, 31 in July, 31 in August and 30 in September, which totals 179, so 1 October is day 180. On 2 October the service will not start and the errorlog shows error 17051. A Standard licence was bought months ago but never applied. Sales is 8.5 GB, under the 10 GB Express limit. The administrator copies Sales.mdf and Sales_log.ldf to a backup volume, confirms the service still will not start, installs Express beside it and attaches the copies so the application is back. The move to Standard stays a separate planned change, raised with Microsoft support.
Confirm the fix
After an Edition Upgrade, connect and run the SERVERPROPERTY('Edition') query again. The value should name the licensed edition, not an Evaluation edition. Check the errorlog for the service starting without a 17051 line, and open SSMS Help, About on any workstation with tools from evaluation media to see whether a component still shows an expiry.
For an Express attach, confirm each database is online and that applications connect with the new instance name.
What to watch afterwards
- Record each licence key location and edition for every instance, so a trial install is never left running unlabelled.
- Calendar the evaluation expiry date at install time: 180 days.
- Agent jobs and logins that were stored in the old instance's system databases.
- If an instance is ever upgraded from Express, Microsoft says to enable the SQL Server Agent service and configure its service account afterwards.
Read next
Related articles you may want next.
- HostingSQL Server editions for hosted applications: Express, Standard and Enterprise limitsWhich SQL Server edition limits on processors, memory, database size and features can actually constrain a business application on a hosted virtual machine, and how the limits changed between SQL Server 2022 and SQL Server 2025.Read article
- HostingSQL Server licensing in virtual machines: per-core minimums, Software Assurance and hosting providersHow Microsoft counts SQL Server core licences for a virtual machine, why a small VM still needs four, what changes when a hosting provider supplies the licence or you bring your own, and when a standby server needs licensing. General information, not legal advice.Read article
- HostingSQL Server support dates for hosted applications: what ended, what ends next, and upgrade checksWhich SQL Server versions still receive security updates, what Extended Security Updates require outside Azure, which versions can upgrade directly to SQL Server 2025, and what to check before an upgrade of a hosted business application.Read article
Risks and limits
These commands have not been run or lab-tested. Microsoft's expired-evaluation page is dated 2023-09-21 and its Applies to list ends at SQL Server 2014; it also describes a separate SQL Server 2008 registry fix that is not repeated here. Edition upgrade paths differ by version. The page used for paths covers SQL Server 2025, and the editions page covers SQL Server 2022. Confirm your own version's page before you act.
Do not change the system clock to extend an evaluation. Microsoft documents no such route. Do not delete the instance or its files until you have a verified copy of the data.
Sources
- Database Engine events and errors (16000 to 17999) — Microsoft Learn, page dated 2026-10-28, accessed 18 November 2026
- Evaluation period has expired error message when working with SQL server — Microsoft Learn, page dated 2023-09-21, accessed 18 November 2026
- In-place change of a SQL Server edition (Setup) — Microsoft Learn, page dated 2026-07-21, accessed 18 November 2026
- Supported version and edition upgrades (SQL Server 2025) — Microsoft Learn, page dated 2026-11-06, accessed 18 November 2026
- Editions and components of SQL Server 2022 — Microsoft Learn, page dated 2026-07-21, accessed 18 November 2026
- SERVERPROPERTY — Microsoft Learn, page dated 2026-09-21, accessed 18 November 2026
- sys.sp_readerrorlog — Microsoft Learn, page dated 2026-10-14, accessed 18 November 2026
This article was originally published on .