Category Archives: Howto’s

How to do stuff!

Figuring out which session is blocking a query on Microsoft SQL Server (query suspended)

I was recently debugging a case where a customer’s installation was hanging due to a database lock. The issue turned out to be that the database was not set to a default transaction level of READ COMMITTED SNAPSHOT, which the product expects. Regardless, while troubleshooting the issue, I stumbled upon a very useful SQL query […]

Finding duplicate files with Bash

Someone recently asked, in #bash on Freenode, how to find duplicate files with Bash. Several options were suggested, and the user ended up installing and running “fdupes“. However, this sort of thing should be reasonably easy to do using “find” and a few pipes. As a quick overview, what you want to achieve is to […]

Installing Windows XP on the Fujitsu Siemens Esprimo u9200 in 2017

I recently picked up a brand new vintage 2009 business targeted netbook, sealed in box – the Fujitsu Siemens Esprimo u9200 (fact sheet) (review => archive). At just short of 2KG (4.37 pounds) it’s rather bulky compared to today’s netbooks, but as a rather disposable piece of equipment for travel, which I’d be perfectly fine […]

Import email from existing POP3 account to Gmail in 2017

No introduction here. Let’s get to it. Go to settings Add an external account Enter your existing external email address, e.g. “you@otherdomain.com” Select POP3 Enter your existing credentials The settings shown are for the Cathedral mail server – yours may be different. Contact your provider if you’re not sure. Choose to treat it as an […]

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. […]