–A database can be dropped regardless of its state: offline, read-only, suspect, and so on.
–To display the current state of a database, use sys.databases catalog view
select * from sys.databases
where name in (‘EAMPC’)
–Database currently being used cannot be dropped.
–This means open for reading or writing by any user.
–To remove users from the database, use ALTER DATABASE to set the database to
ALTER DATABASE EAMPC
WITH ROLLBACK IMMEDIATE;
–Dropping a database deletes the database from an instance of SQL Server and
–deletes the physical disk files used by the database.
–If the database or any one of its files is offline when it is dropped,
–the disk files are not deleted. These files can be deleted manually by using
–Windows Explorer. To remove a database from the current server without
–deleting the files from the file system, use sp_detach_db.
drop database EAMPC;