How to Delete all objects in a particular database?

Database
Enthusiast

How to Delete all objects in a particular database?

I understand that before you can drop any database you have to delete all the objects it contains.

I used the "help database database_name" command and it showed me that my particular database had 61 tables, views and macros.

I confirmed this by checking from Teradata Administrator.

My question is this, how can you delete all the objects in a particular database without having to write the delete command for every object?

Is there any SQL statement or dynamic SQL statement that will do this for me?

2 REPLIES
Senior Apprentice

Re: How to Delete all objects in a particular database?

Yes, there is :-)

DELETE DATABASE xy;

Dieter

Enthusiast

Re: How to Delete all objects in a particular database?

Cheers!