deleting an sql database
-
how to delete a sql database. it contains a single table. I have tried dropping the table first. the table is deleted, still i get an exception saying the database is being used. thanks in advance.
Keshav Kamat :) India
-
how to delete a sql database. it contains a single table. I have tried dropping the table first. the table is deleted, still i get an exception saying the database is being used. thanks in advance.
Keshav Kamat :) India
-
how to delete a sql database. it contains a single table. I have tried dropping the table first. the table is deleted, still i get an exception saying the database is being used. thanks in advance.
Keshav Kamat :) India
Hi, When u cannot delete a database that means that a connection to the database is still alive. - If u want to delete it from SQL Server Entreprise manager, do the following : 1- Right click on the database 2- Choose All tasks \ Detach database 3- U can see the number of connections to the database. Click on the Clear button to force open connections to disconnect. 4- Do not detach the database but click on cancel and now u can delete the database. - If u are deleting the database from SQL Query Analyzer be sure to be not connected on the database to delete. Choose the master database in the combobox. To delete the database just execute the query : Drop database YourDatabase. - If ure using .net to delete the database. U must turn off Pooling in your connection strings. That's because even u close all connections by using Connection.Close() method, connections still open for performance reasons. HTH.