Sometimes SQL server service tends to stop or fail due to many factors, such as Operating system issues, HardDisk issues, or simple issues such as a service account password change without updating on the server where the SQL server instance is installed. To get your SQL Server to restart automatically, follow the below steps:
-
First, We will need to install a software which will send you a notification email upon service failure. Go to Blat.net and install blat (put your windows version in consideration - 32-64 bit)
-
Configure Blat with the required SMTP credentials from command line (help with that is available on blat.net website as well as the downloaded file.)
-
From your start menu, open Services.msc as an administrator.
-
A New window will appear with the list of running services, scroll to “SQL SERVER (your instance name)”
-
Right click on that service and and click “Properties”, a new pop up window will appear
-
Click on the “Recovery Tab”
-
Make sure that “Reset fail count after” is set to 1 days, and “Restart service after” is set to 1 minute. Leave “Enable actions for stops with errors” unchecked.
-
Change “First Failure” and “Second Failure” to “Restart the Service”
-
Change “Subsequent Failures” to “Run a Program”.
-
In the “Run Program” section in the same tab below, point to your blat installation
-
In the command line parameters, type: -to <your email address without these qoutes> -subject “SQL Failure” -body “Your SQL Server failed after multiple restarts, please check your server, settings, disk space, or any other factor that is causing SQL Service to fail.”
-
Leave “Append fail count to end of command line” unchecked

|