Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Oliver wang
Yak Posting Veteran
50 Posts |
Posted - 2011-08-11 : 03:37:43
|
hello everyone,Here I got an issue. I want to delte a database on my server. But when I delete, an error pops up saying there are some user connections on the database, which prevent me from doing that. I know one possible way to sovle this is using "kill" command. But what if there are hundreds of user connections? Do I need to kill those connections one by one which is time consuming?Thank you very much in advance.regards,Oliver |
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-08-11 : 03:40:58
|
Hm, dropping a database with hundreds of connections sounds like a bad idea. But try this:USE mastergoEXEC sp_dboption 'databasename', 'single_user', truegoDROP DATABASE databasenamego - LumbagoMy blog-> http://thefirstsql.com/2011/07/08/how-to-find-gaps-in-identity-columns-at-the-speed-of-light/ |
 |
|
Sachin.Nand
2937 Posts |
|
Oliver wang
Yak Posting Veteran
50 Posts |
Posted - 2011-08-11 : 04:07:16
|
Hi Folks,Thanks for your timely response. Your suggestions help me a lot.regards,Oliver |
 |
|
|
|
|