MissTips, Running sp_detach_db will not succeed if connections still exist to the database that you want to detach. When connections still exist to the database that you are trying to detach, running sp_detach_db gives the following error message: "Cannot detach the database 'd_HEAT' because it is currently in use."
I think saw15 wants to know, as I do, the T-SQL command(s), which can be executed in Query Analyzer, to stop all connections to a target database (in preparation to detach that database).
Also, depending on what you are REALLY trying to do...the KILL command can be used to kill a connection. See KILL in the BOL.
Are you trying to disconnect users so you can detach the database? Or are you just trying to disconnect users that shouldn't be connected or are causing a block?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.