SDU Tools: Last SQL Server Restart
Our free SDU Tools for developers and DBAs, now includes a very large number of tools, with procedures, functions, and views. A request that I had a while back was to have a function that returned the last time that SQL Server was restarted. So we added the LastSQLServerRestart function.
It takes no parameters.
I used to have a more complex way to work this out, but thanks to a great suggestion from our buddy Rob Wylie, it now just looks for the creation time of tempdb. That’s pretty good and simple to implement.
2025-02-17