You can drop a temporary database only if it has:
No bindings associated with it, and
No active sessions assigned to it.
This means that the database:
Should not be part of the default temporary database group, and
Should have no logins or applications bound to it.
If any bindings exist, drop database reports a failure. Remove the database from the default group, and unbind all such logins and applications. Use the sp_tempdb “show” interface to determine all bindings involving the temporary database.
If there are any active sessions connected to the database being dropped, drop database fails. Such sessions can exist if they were instantiated before the bindings for the database were removed. To proceed with the drop process, a user must either wait for all such active sessions to drain out of the system, or kill these sessions. Use sp_tempdb “who” dbname to determine what sessions are currently connected to a given temporary database.