Drop Databases

Database
Enthusiast

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 !

3 REPLIES
Teradata Employee

Re: Drop Databases

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;
Enthusiast

Re: Drop Databases

Please refer to this discussion for dropping database and its objects.

https://forums.teradata.com/forum/database/how-to-delete-all-objects-in-a-particular-database

for the 2nd question, yes you can drop the table having data in it, you need not clear the data to drop the table.

Enthusiast

Re: Drop Databases

Thanks a lot!