Friday, July 23, 2010

Oracle: Generate SQL script to drop all tables of any database

In oracle there is no option to drop all the user tables, but you can achieve this by generating a scrip and run that script.
To generate a script for dropping all the user tables, simply run this query and then run the result/output of this query.


SELECT 'DROP TABLE '||table_name|| ' CASCADE CONSTRAINTS;'
FROM user_tables;

No comments: