Tomas' Labroratory

MS SQL 1807 Error - Solved

While trying to create a new database in MS SQL , I kept getting a 1807 error, complaining that MS SQL can't obtain exclusive lock on database 'model'

Create failed for Database 'x'. (Microsoft.SqlServer.Smo)

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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)

To solve this:

KILL $SPID GO

Notes regarding killing processes: