Monthly Archives: August 2016

Setting all SQL Server databases to “simple” recovery model and deleting all the transaction logs

Sometimes, you just want things brutally simple and stupid. I was searching for how to do this, and stumbled upon this post on SQL Server Central. Turns out the query listed there doesn’t handle databases with weird names, containing version numbers with “.” in them, for instance. Thus, I modified it slightly, adding brackets and […]

Debugging SQL Server Query Performance

To enable timing of your query: SET STATISTICS TIME ON Time statistics provides output like this in the “Messages” tab of SSMS after running a query: (127 row(s) affected)  SQL Server Execution Times:    CPU time = 0 ms,  elapsed time = 42 ms. To show IO statistics: SET STATISTICS IO ON ..which provides stuff […]

Force SQL Server Database offline

If you right click a database in SSMS and select Tasks => Take Offline, you might find yourself staring at this dialog for hours, if there are active sessions running queries on your database. Here’s how to force it to go offline, rolling back any current transactions. Replace [dbname] with the name of your database. […]

Fixing empty search results in the Windows 10 Settings (the shiny new Control Panel)

This happened on a few machines I am responsible for, after the upgrade to Windows 10. You click “Start”, type “updates”, it suggests “Check for Updates” in the “Settings” app, you click <enter> and it opens an empty settings window with no search results. Great. After looking around for a while, I stumbled over the […]