分离数据库失败 [英] Detach Database fails
本文介绍了分离数据库失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试分离数据库"temp",但出现以下错误.
只有用户进程可以被杀死.无法分离数据库"temp",因为它正在使用中.
我要先杀死所有进程,然后再使用"kill ProcID"将其分离.
在我的过程中,我将附加正在处理的临时数据库,然后将其分离.
当我第一次重新启动SQL Server时,我能够成功分离它.但是之后所有尝试都失败了.
请帮助,
Thanx
I am try to Detach the Database "temp" but i am getting the following error.
Only user processes can be killed. Cannot detach the database ''temp'' because it is currently in use.
i am killing all its processes before detaching it using "kill ProcID".
In my process i am attaching the temp database working on it and then detaching it.
When i restarts the SQL server for the first time i am able to detach it successfully. but after that all the attempts fails.
Plz help,
Thanx
推荐答案
可能您的代码处于活动状态,可以维持连接,这就是失败的原因.完成后,请确保在提供它的任何数据库对象上调用Dispose.
Probably you have code active that is maintaining a connection, and that''s why it fails. Make sure you call Dispose on any DB object that offers it when you are done with it.
这篇关于分离数据库失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文