I want to create a cmd script to upgrade sql servers in the organization(mostly 2014) to 2016. I've read Microsoft documentation
Install SQL Server 2016 from the Command Prompt regarding this issue.
The problem is that there is no option written there to upgrade all server instances like there is in installing updates: Installing Updates from the Command Prompt using /allinstances
.
Is there any way to auto upgrade all instances on the server using one command line?
Sql-server – All instances upgrade from Command Prompt
command linesql serversql-server-2016upgrade
Related Question
- Avoid Forced Reboots Using Unattended Upgrades in SQL Server 2014
- SQL Server – Recommended Ways to Upgrade AlwaysOn AG from 2014 to 2016
- Sql-server – SQL Server 2016 in-place upgrade time for large databases
- SQL Server 2014 – Resolving Inaccurate Patch Level Issues
- SSRS 2017 – Can It Be Used with SQL Server 2016?
- SQL Server Upgrade – How to Upgrade SQL Server 2016/2017 Standard to Enterprise
- Sql-server – sql command utility version is not working
Best Answer
You can first download the SQL server 20XX edition of your needs here. Then you can download and extract the local content media on your machine. After that you should see in the downloaded folder the
SETUP.EXE
file Then you can open the command prompt and type (By considering your sql standard instance name is MSSQLSERVER):When you connect to your database, you should see the new version installed . In my case I upgraded from SQL server 2017 to SQL server 2019. Old Maj version was 14.XX, now the new Maj version is 15.XX. See below.
And there are plenty of cool explanations on this page
EDIT: I think its not possible to upgrade all instances at one with the
allinstances
parameter, because not allowed (Tried it). Here is what the command line says:Bu you can loop with powershell on all your instances with the above command. If you dont have 1 million instances, it should be fine.