Contents

SQL Server Evaluation Time expired. SQL service wont start. Event 17051

Website Visitors:

There may be times when you want to test the SQL server instance first and then purchase a license key after your testing is successful. When you want to apply license key, you have to do it, at least one day before your evaluation time expires. If your expiration date is crossed, your SQL service will not start.

https://www.mediafire.com/convkey/da21/hi28z2guufkvom57g.jpg
SQL Server Evaluation Expired Eventlog

When you try to change the SQL server instance from evaluation to full using a license key, through GUI or command line, it tries to check the SQL service status first. If the service is stopped, setup tries to start it when applying a full license key. If your evaluation license time period is expired, SQL service will not start.

In this case, you have to set the time on your SQL server back when the evaluation time was active. To find that time details follow any of the solutions below:

  • Go to the path, C:\Program Files\Microsoft SQL Server\sqlVersionNumber\Setup Bootstrap\Log and look for summary.txt file. This file will have the evaluation start time and end time.
  • Go to add or remove programs and check the date when SQL software was installed. Evaluation starts when the software is installed.

If SQL server is installed on 01-Nov-2020, set the SQL server’s time (windows system time) as 10-Nov-2020. Once done, start the SQL service. Once the service is started, apply the license key using the GUI or command prompt. It works as the SQL service is started.

Set time on SQL server

You can use below powershell command to change the date to 180 days back from your current date.

1
set-date -Date (Get-Date).AddDays(-180)

OR

If you have a gpo for setting up the time, and it changes automatically while you’re starting the sql service, you can use below command to run it in loop. Set-Date powershell command uses mm/dd/yyyy format. Below command sets the time to 15 February 2022.

1
while ($true) {set-date -date 02/15/2022}

Apply SQL key command line

If you wanted to apply the SQL key through command line, mount SQL setup iso into your dvd drive and run below command:

For Default Instance:

Setup.exe /q /ACTION=EditionUpgrade /INSTANCENAME=MSSQLSERVER /PID=KEY_HERE /IACCEPTSQLSERVERLICENSETERMS

For Named Instance:

Setup.exe /q /ACTION=EditionUpgrade /INSTANCENAME=InstanceName /PID=KEY_HERE /IACCEPTSQLSERVERLICENSETERMS

Note: Through a group policy or local GPO, if date and time are set automatically, they will change within sometime automatically by that policy. So, in an administrator windows command prompt or PowerShell command prompt, set the pastime continuously like, run “Set-Date -Date 10/Nov/2020” command on PowerShell console continuously. So, with the GPO, if it is changed again, you are changing it immediately. So, SQL service will be in started state for sure. You can then apply your license key.

Once applied, you can set the time back to normal again. Reboot the server once done and connect using SSMS.

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: