killing database connection | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

killing database connection

I’m trying to restore databases locally on a server after using cmdshell to copy the dump files over from live server and i’m having problem with connection on the databases even after running scripts to kill all the database connections to the server i still get an error message that the database is in use when i try to restore. i set it as a job that disconnects dbase connections and then restores the database. i need to know if i’m missing something.
Run SP_WHO2 and look for any connections holding for that database.
Also you can use [single user] configuration by using SP_CONFIGURE for that database. Refer to BOL for more information. _________
Satya SKJ

sorted!!it was just a simple issue of running the restore job in the user database and not master with sp_dboption syntax, so each time the job is executed it reconnects to the database but it’s sorted now thanks.
True, it happens always. _________
Satya SKJ

]]>