Error upgrading SQL Server 2012 to SQL Server 2017 using command line

Henrik Larson 96 Reputation points
2021-08-19T18:29:22.793+00:00

I try to upgrade a SQL Server 2012 SP4 instance to SQL Server 2017 on Windows 10 using the command line. I get the error below. Searching for the problem gives hints about changing the system locale, but I already have en-US in Windows and the same SQL 2017 setup.

If I run the same setup with user interface it works fine, but I need to use the command line.

PS C:\sql2017\SQLEXPR_2017_x64_ENU> Get-WinSystemLocale

LCID Name DisplayName


1033 en-US English (United States)

PS C:\sql2017\SQLEXPR_2017_x64_ENU> .\SETUP.EXE /Action=Patch /AllInstances
Microsoft (R) SQL Server 2017 14.00.1000.169
Copyright (c) 2017 Microsoft. All rights reserved.

The following error occurred:
The SQL Server license agreement cannot be located for the selected edition, EXPRESS. This could be a result of corrupted media or the edition being unsupported by the media.

Error result: -2054422501
Result facility code: 1420
Result error code: 27

Please review the summary.txt log for further details
PS C:\sql2017\SQLEXPR_2017_x64_ENU>

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,010 questions
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
538 questions
{count} votes

Accepted answer
  1. Henrik Larson 96 Reputation points
    2021-08-20T15:40:22.287+00:00

    Okay, I thing I have found my problem. The action "Patch" will update SQL Server, but I want to upgrade my SQL Server and need to use the action "Upgrade". This command line worked for me:

    setup.exe /QS /ACTION=UPGRADE /INSTANCENAME=Test /IACCEPTSQLSERVERLICENSETERMS

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. YufeiShao-msft 7,121 Reputation points
    2021-08-20T09:24:35.513+00:00

    Hi @Henrik Larson ,

    This error is probably caused by a corrupted media as mentioned on the error message. Please try to download:
    https://www.microsoft.com/en-us/download/details.aspx?id=55994

    and please verify that the following operating system settings match the language of the localized SQL Server to be installed:
    The operating system user interface setting
    The operating system user locale setting

    https://learn.microsoft.com/en-us/sql/sql-server/install/local-language-versions-in-sql-server?view=sql-server-ver15#BK_ConfigureOS

    0 comments No comments

  2. Henrik Larson 96 Reputation points
    2021-08-20T10:14:32.63+00:00

    @YufeiShao-msft thanks for your reply.

    First, isn't the English-US SQL setup supposed to be possible to use on all operating systems. The link in your post tells that:

    • The English-language version of SQL Server is supported on all localized versions of operating systems.

    All language settings on the computer are set to English:

    125054-language1.png

    125007-language2.png

    125034-language3.png

    Finally I downloaded SQL 2017 setup again and tested with the same error. I also downloaded SQL 2019 and get the same error.

    0 comments No comments

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.