When dropping a SQL Server 2008 login as part of integration test execution I sometimes get the following error:
System.Data.SqlClient.SqlException: Cou
In SqlServer Studio on the Master DB.
Use the command sp_who2 to list the opened sessions.
In the list find the spid for your user - there may be more than one - e.g. 999
Use kill and the spid to close all the sessions e.g.: kill 999
Then DROP LOGIN [theuser]