when you drop datebase with SQLCMD tool, and met the error message as title, you can try below script.
---script start---
use master
go
alter database databasename set single_user with rollback immediate
go
drop database databasename
go
---script stop---
the parameter be marked with yellow is important
Cannot drop the database 'databasename' because it is currently in use
最新推荐文章于 2023-03-30 15:11:42 发布