如果文件消失了如何删除(localdb)数据库 [英] How to delete (localdb) database if the file is gone

查看:379
本文介绍了如果文件消失了如何删除(localdb)数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我运行SQL Server Management Studio,并告诉它连接到(localdb)\ v11.0,则尽管大多数数据库文件已经消失了,但它知道我曾经使用过的每个数据库.

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.

如果我要求它删除这些数据库之一,它会抱怨它无法删除数据库,因为数据库文件已丢失(duhhh).那么,如何清除此混乱并删除其关联数据库文件已消失的所有数据库引用?

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?

鲍勃

推荐答案

在这种情况下,请分离数据库,而不要尝试删除它.在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".

这篇关于如果文件消失了如何删除(localdb)数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆