Monday, March 19, 2012

Force Drop Database

Hi everybody,

I would like to know if there would be any special way to force drop a database from an ASP.NET page.

When I try to do it in the normal way, it gives me an exception like: Cannot drop the database 'xxxxxxx' because it is currently in use. I'would have to wait until there is a timeout.
In fact that database can be accessed from another pages, but I want to know if I'd be able to force drop database even when another pages are using it.

Thanks in advanceWhy must you be able to "drop" a database while it's still in use?|||Just imagine an application that creates a database for each customer, which contains personalized data for another application. Then just imagine that one customer doesn't pay his/her month fee and we wanted to delete his/her data, but he is still using it. Of course because we are the application admins, we have to be able to do that, even if database is still in use.

I hope this answer convince you and could tell me if there's a solution.

Thank you|||Personally, I wonder what happens if just after you drop the database, the user's payment arrives. To handle this scenario, I would have some other way of controlling a user's access to the system rather than deleting the database. Perhaps a flag in the database to tell you if the user should be able to access the database. I actually wonder about one database per customer, but that is an entirely different issue...

No comments:

Post a Comment