Cannot drop the database 'databasename' because it is currently in use

来源:互联网 发布:淘宝店铺名字在哪里改 编辑:程序博客网 时间:2024/05/17 01:04

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

原创粉丝点击