One of our clients is running Windows Small Business Server 2011, and they have a SQL 2005 Server Express instance (and several other versions also installed).
Using Management Studio, running as administrator, I cannot seem to create any databases. The error I get is:
Could not obtain exclusive lock on database 'model'. Retry the operation later.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 1807)
The first time this happened, there happened to be a backup task running which had a lock, so I tried again later, and still had the issue. Running EXEC sp_who2 shows only my own user with 2 locks on the model db, both are "sleeping", and seem to come from the Management Studio (.Net SQL Client, same last batch as when I started the app).
Unfortunately I mostly work with MySQL, so all this MS stuff is over my head.
Edit:
Here is the result of SELECT * FROM sys.sysprocesses WHERE DB_NAME(dbid) = 'model'
Result:
+------+------------------------------+------+-----+-------------+------------+-----------+-------------+----------+-------------+------------------+----------------------+
| spid | lastwaittype | dbid | uid | physical_io | login_time | open_tran | status | hostname | hostprocess | cmd | loginame |
+------+------------------------------+------+-----+-------------+------------+-----------+-------------+----------+-------------+------------------+----------------------+
| 1 | SLEEP_TASK | 0 | 1 | 0 | 12:45.8 | 0 | background | | | RESOURCE MONITOR | sa |
| 2 | LAZYWRITER_SLEEP | 0 | 1 | 0 | 12:45.8 | 0 | background | | | LAZY WRITER | sa |
| 3 | LOGMGR_QUEUE | 0 | 1 | 0 | 12:45.8 | 0 | suspended | | | LOG WRITER | sa |
| 4 | REQUEST_FOR_DEADLOCK_SEARCH | 0 | 1 | 0 | 12:45.8 | 0 | background | | | LOCK MONITOR | sa |
| 52 | MISCELLANEOUS | 3 | 1 | 0 | 05:14.5 | 0 | sleeping | BH-SBS | 6976 | AWAITING COMMAND | BH\nuser |
| 62 | MISCELLANEOUS | 3 | 1 | 0 | 04:13.0 | 0 | sleeping | BH-SBS | 6976 | AWAITING COMMAND | BH\nuser |
| 74 | MISCELLANEOUS | 3 | 1 | 5 | 02:23.1 | 0 | runnable | BH-SBS | 22436 | SELECT | BH\nuser |
+------+------------------------------+------+-----+-------------+------------+-----------+-------------+----------+-------------+------------------+----------------------+