Your model
database is locked
locked now so what you should do is to find out the session that has a lock
lock on it, this can be done using sys.dm_tran_locks
:
select request_session_id
from sys.dm_tran_locks
where resource_type = 'database' and
resource_database_id = 3 and
request_type = 'LOCK' and
request_status = 'GRANT';
The approach mentioned in another answer can not work if there was no request
to model
database at all, youYou can have a user that just opened SSMS
an SSMS query window with the context of model
database and did not ever execute any query there, but that session still holds S
lock on database
the database resource.
Once you have found the locking session, just kill it.