I am using MS SQL Server 2014, When I restart my Pc the SQL Server Service does not start automatically, however, it does after Windows Shutdown and run again, how can I make it restart automatically ?
-
1What is the difference between two actions: (Restart) and (Shutdown and start again) ?– Yousef AlbakoushDec 7, 2018 at 20:00
-
1There really shouldn't be any.– LowlyDBA - John MDec 7, 2018 at 20:01
-
The solution of using batch file is some workaround, but it should work without that, this is why asked this question.– Yousef AlbakoushDec 7, 2018 at 20:11
1 Answer
You can set the service property to restart it (service properties --> recovery --> first / second / third failure and have a delay between each restarts e.g. 1 min). You should also, have the service set to automatic delayed start.
Alternatively, you can use powershell and schedule it in task manager to check if the service is running or not. If not running, restart it.
get-service and restart-service are your friends.
-
Unfortunately, the first option doesn't solve the problem. I'll try the second option and see how. Dec 7, 2018 at 19:40
-
When I use this command net start "My_SQL_SERVER" in a batch file it worked and my service start, but it was working without that Dec 7, 2018 at 20:06