'SQL Server 2012 & SSMS - How auto-retry after "A transport-level error has occurred"?

After unsleeping my laptop (or losing my broadband connection for a second) when I go to execute any of my open queries in SSMS they bring up the

A transport-level error has occurred

error message. I then just click OK and rerun the query.

Is there any way to get SSMS (v15.0.18390.0) to auto retry the query so I can run the query with just a single click on Execute rather than click on Execute, click OK on the error and then click on Execute again?

SSMS is running on Windows 10.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source