4

Some SQL Server updates have happened outside the maintenance window, which have caused the server to be rebooted. How can I stop this from happening again in future?

Below is what I can see when looking at the Windows Update Settings:

enter image description here

Ian Kemp
  • 322
  • 1
  • 12
RGO
  • 403
  • 4
  • 11

1 Answers1

6

To prevent SQL Server updates to be installed automatically, you need to:

  1. open up PowerShell window (Command prompt will also work)
  2. type "sconfig.cmd" and run it
  3. press 5 to select "Windows Update Settings"
  4. set it to "M" which is "Manual"

Important: choose "Manual", NOT "DownloadOnly", because even with "DownloadOnly" setting, some Windows Updates that Microsoft considers very important, may be still installed and machine will be rebooted (I've experienced it myself)

This way you have total control over when and how to install Windows and SQL Server updates

enter image description here

Aleksey Vitsko
  • 4,308
  • 3
  • 21
  • 47
  • 1
    I think you should attribute the source of above details also --> https://www.hostwinds.com/guide/how-to-disable-automatic-updates-and-restarts-in-windows-server-2016/ – Learning_DBAdmin Aug 17 '20 at 08:04
  • 2
    One can also run sconfig from a Windows admin command prompt; no need to run via PowerShell. – Dan Guzman Aug 17 '20 at 10:57
  • 3
    @Learning_DBAdmin Why? There doesn't seem to be anything to suggest that this answer used anything from that page. – Anthony Grist Aug 17 '20 at 15:02
  • @DanGuzman That's correct, Thanks. I have suggested an edit to the answer. – RGO Aug 18 '20 at 13:39
  • Without knowing how the asker's environment is set up regarding areas of responsibilities for SQL vs. the operating system, I'm wondering if this answer deserves some sort of a caveat. Stopping Windows Updates can run afoul of various security and compliance requirements. – Doug Deden Aug 18 '20 at 18:35