All Forums Database
GianTD 47 posts Joined 11/14
29 Oct 2015
Drop Databases

Hello !
We need to drop few databases.
Can we drop database even if it has tables?
Same with tables, can we drop tables having data?
Whats the best approach to do this?
Thanks !

tomnolan 594 posts Joined 01/08
29 Oct 2015

A database must be empty before it can be dropped.
The "delete database" command drops everything in a database.
So dropping a database is a two-step process:

delete database OldJunk;
drop database OldJunk;


kirthi 65 posts Joined 02/12
29 Oct 2015

Please refer to this discussion for dropping database and its objects.
for the 2nd question, yes you can drop the table having data in it, you need not clear the data to drop the table.

GianTD 47 posts Joined 11/14
30 Oct 2015

Thanks a lot!

You must sign in to leave a comment.