gpt4 book ai didi

数据库 "Unable to open physical file"的 SSMS 删除失败

转载 作者:行者123 更新时间:2023-12-04 20:01:37 24 4
gpt4 key购买 nike

试图在其他地方找到这个没有运气。

我正在尝试删除磁盘上不再存在的数据库,但仍显示在 SSMS 2014 的对象资源管理器中

那么如何从对象资源管理器中“清除它们”呢?

我是否需要从 sys.master_files 中手动删除它们?

异常(exception)是:

    Drop failed for Database 'aspnet-Blawblaw-20141027015559'.  (Microsoft.SqlServer.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.2000.8+((SQL14_RTM).140220-1752)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+Database&LinkId=20476

------------------------------
Program Location:

at Microsoft.SqlServer.Management.Smo.SqlSmoObject.DropImpl()
at Microsoft.SqlServer.Management.Smo.Database.Drop()
at Microsoft.SqlServer.Management.SqlManagerUI.DropObjects.DoDropObject(Int32 objectRowIndex)
at Microsoft.SqlServer.Management.SqlManagerUI.DropObjects.DropAllObjects(Boolean stopOnError)

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.DropImplWorker(Urn& urn)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.DropImpl()

===================================

Unable to open the physical file "C:\Projects\BlawBlaw\BlawBlaw\App_Data\aspnet-BlawBlaw-20141027015559.mdf". Operating system error 3: "3(The system cannot find the path specified.)".
File activation failure. The physical file name "C:\Projects\BlawBlaw\BlawBlaw\App_Data\aspnet-BlawBlaw-20141027015559_log.ldf" may be incorrect. (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3000&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
Server Name: (LocalDb)\v11.0
Error Number: 5120
Severity: 16
State: 101
Line Number: 2


------------------------------
Program Location:

at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.Sq

最佳答案

这对我有帮助。

  • 新建查询
  • 复制数据库的名称 (F2)
  • 运行此命令:DROP DATABASE [C:TEST.MDF]-- 当“test”是数据库名称时
  • 执行
  • 刷新后,数据库下不显示DB字符串
  • 关于数据库 "Unable to open physical file"的 SSMS 删除失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29108340/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com