Database clients: how to wait for database activation after SQL Server restart?
问题 Service dependency is not enough to guarantee that database clients will find their SQL Server up and running after a system reboot. They may be able to create a connection to the master database, but a specific database may still be in the process of opening (in the recovery mode) and connections to it will be refused for some initial period of time. The exact duration of the delay is highly variable and depends on factors such as number of databases on the system, recovery mode, LDF file