如果我运行SQL Server Management Studio并告诉它连接到(localdb)\ v11.0,它知道我曾经使用过的每个数据库,尽管大部分数据库文件都已经过去了。
如果我要求它删除这些数据库中的一个,它会抱怨它不能删除数据库,因为数据库文件不见了(duhhh)。 那么,我该如何清理这个混乱,并删除所有数据库引用的辅助数据库文件都不见了?
短发
If I run SQL Server Management Studio, and tell it to connect to (localdb)\v11.0, it knows about every database I've ever used, despite the fact that most of the the database files are long gone.
If I ask it to delete one of these databases, it complains that it can't DROP the database because the database file is gone (duhhh). So, how do I clean up this mess and delete all of database references whose assicated database files are gone?
Bob
最满意答案
在这种情况下,分离数据库而不是试图放弃它。 在SQL Management Studio中,右键单击数据库,选择“任务”,然后选择“分离”。
In this situation, detach the database rather than trying to drop it. In SQL Management Studio, right-click on the database, select "Tasks" then "Detach".
更多推荐
发布评论