Friday, 23 September 2016

How to drop or delete all tables from database with one SQL query

How to drop all tables from database with one SQL query?

You can write query like this:

USE Databasename

SELECT  'DROP TABLE ' + name + ';'
FROM    sys.tables
You can copy and paste into a new SSMS window to run it.

No comments:

Post a Comment