My good friend and SQL Server guru Pinal Dave did a excelent question in his site :
In this post, he ask if we stop the SQL Server service using stop-service –force it is the same to use T-SQL Shutdown or Shutdown with NoWait.
Lets see the documentation first.
The –force parameter in the stop-service is to use when the service has dependent services , as the SQL Server service has the SQL Server Agent .
Also , according the technet, other tools and methods to stop SQL Server performs checkpoint in each database :
But it not says nothing about PowerShell, so I had to test tracking the checkpoints using trace flags 3502/3605 to log the checkpoints in the SQL Server Error log:
First Test : Using Shutdonw.
and it performs the checlpoints :
Second Test – Using NoWait
As we can see, no checkpoints were performed
and the rollback were performed when started the SQL Server :
Third Test – Using Stop-Service
Firts enabled the trace flags :
Then run the stop-service :
and then :
So the asnwer is :
STOP-SERVICE -force is like to use SHUTDOWN, performing the checkpoint in each database 🙂