Monday, 10 August 2015

SQL: How to Resolve "Alter Database Failed because a lock could not be placed on database"

I was trying to set a database offline, and I encountered this error:











It's possible that a connection was not terminated.
To fix, identify the process that causing the lock on the database.

exec sp_who2

and kill the process

kill <spid>


No comments:

Post a Comment