0

I want to delete all the data from one database but the structure of the table needs to be there. What will be the cleanest way to do that?

1 Answers1

1
  1. Disable foreign key check.
  2. Truncate all tables.
  3. Enable foreign key check back.

Alternatively:

  1. Backup the database without data (only tables, functions, procedures, triggers).
  2. Restore into new database.
Akina
  • 39,301
  • 5
  • 14
  • 25