Thursday, 4 February 2021

MSSQL - Query to drop all tables in database

 Watch this example on YouTube


 

Be careful - this will delete all data in your database

use OnlineStore
go
Exec sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT All"

Use OnlineStore
go
Exec sp_MSforeachtable @Command1 = "Drop Table?" 

No comments:

Post a Comment