Category Archives: Howto’s

How to do 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 […]

SPF exists for a reason, and postfix makes it ridiculously easy

In the bronze age, messages came in, signed bob@lamuella.com, and you’d simply have to assume they were from the Almighty Bob. Today, email is still technically in the iron age, but at least we have SPF. In a nutshell, when lamuella.com enables SPF for their domain, they can be sure that other people, which mail […]

MSSQL Mass Delete

To avoid holding up everything else when deleting massive amounts of data from an SQL Server table, you can use the TOP() function to delete the data in chunks. SELECT 1 WHILE @@ROWCOUNT > 0 BEGIN DELETE TOP(1000) FROM [dbo].[mytable] WHERE timestampUtc < ‘2015-05-29’ END The “SELECT 1” primes the @@ROWCOUNT variable, so the while […]

Moving Windows’ Offline File Cache away from C:\

Got a small SSD as your C drive? So do I. Storing your documents on a network drive? Yep. Want to index that network drive, to include it in libraries, searches, etc? You bet. You’ll want to move your offline cache. Create a folder for your offline file cache. Something like D:\Cache From an elevated […]