• I agree, I think the ALTER DATABASE <databaseName> SET SINGLE_USER WITH ROLLBACK IMMEDIATE is more elegant and precludes the risk of active connections occurring while the cursor is killing the ones it knew about at the time the cursor was opened.