Who’s connected to my MSSQL server?

Today I was trying to restore a backup of our MSSQL server when a user decided to drive me crazy by not disconnecting after telling anyone that we need to do that restore. So I fired up the management studio and had a look at the current processes by using the following query:

As I wasn’t in the mood to argue with users today and begging them for cooperation, I decided to do it the uncomplicated way by killing some processes. Identifying the user would be unneeded, as that guy would call the support hotline anyways, ending up at my desk.

A SQL script looks up the processes accessing the database I am about to restore and kills those:

And finally the restore worked without problems. Talking about timing, the user who wouldn't want to disconnect called me. I picked up the phone and said with a voice as sweet as possible "Simon, Operator speaking?"...