Kill Processes as a whole.. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Kill Processes as a whole..

We have a db that is so large a simple copy database wizard is failing, and was giving me NO errors detailed reason why. Therefore I switched gears, and had to do a backup from my source db, then copy the physical .bak file over to the target machine then restore it from there, it worked finally. However now im running into a problem where it says it cannot get exclusive access to the db to do the restore. Anyone know of a way to "kill" all the users in that DB with one transaction. Taking the db offline will give me the same can’t do it while people are in the db, so I would still be in the same boat.. Thx,
David
-David Roesch
San Diego, Ca
There are scripts for that kind of thing here: http://www.sql-server-performance.com/q&a37.asp or this http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci840255,00.html Nathan H.O.
Moderator
SQL-Server-Performance.com
Other way is using EM, select all users and drop.
Luis Martin …Thus mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true.
Bertrand Russell
Thank you that script(sp) worked exactly as I hoped.. <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /> We wanted to automate this at 3am so I was not all that excited about wakin up at 2:45 to kill the users through EM every day.. =)<br /><br /><br /><br /><br />-David Roesch<br />San Diego, Ca
No sweat. I thought killing people at night was the normal thing to do unless you want to get caught. Enjoy your sleep. Nathan H.O.
Moderator
SQL-Server-Performance.com
]]>