This is a duplicate of the question I asked on stackoverflow, but I was advised, that someone here could have a better idea what is happening.
I have a sporadic problem, when upgrading SQL Server in a single-user mode, using .NET SqlConnection, some other application somehow logs into the database, while the SQL code is being executed, and kicks my process out. SqlConnection is not closed or disposed in any way. But some other application somehow ends up connected to the database and that kicks my connection out.
When I run sp_who, I could see that a process that took control of the database is Command="TASK MANAGER".
Anyone could tell me what is this process, what is it's purpose, and how in the world it could get into a database, which is in single-user mode, and there is an active connection?