Skip to main content

Delete all tables of a database


Below SQL select statement create list of SQLs to delete all tables

For ORACLE schema

SELECT 'DROP TABLE "' || TABLE_NAME || '" CASCADE CONSTRAINTS;' FROM user_tables;



For MSSQL schema


use [database_name]
SELECT 'DROP TABLE {user}.' + NAME FROM sys.objects where type = 'U';

Where {user} is the owning user of the tables.






(drop all tables of database)

Comments

Popular posts from this blog

SSL in pictures

Here is my summary on SSL (or as I like to call it 'SSL for dummies')

Digital signature in pictures

I never remember what happens when digital signature is used. So here is my summary 'Digital signature for dummies'.

Jenkins error: groovy.lang.MissingPropertyException

I tried to run groovy build step and got below error. This post will describe how I solved the problem. Caught: groovy.lang.MissingPropertyException: No such property: hudson for class: script