How to dleete Database.

  • Thread starter Thread starter Mahesh D. Rane
  • Start date Start date
M

Mahesh D. Rane

Hi,

How to forcefully delete sql database even if the
connection to that database is open. I want some query or
code in C#.

Regards,
Mahesh
 
I take it you are not just trying to delete the records with

delete from
or
truncate tablename

You will need to detach the database from the DBMS then delete the file.
This will require you to have SA rights
You may have to close each of the connections, except your own
Close your own connections
Detach the DB from the DBMS
Delete the file.

those are the basic steps

Wade
 
Back
Top