sql server: delete all the rows of all the tables

前端 未结 4 1936
栀梦
栀梦 2020-12-09 14:06

I\'d like to clear the database altogether and reset the data. What\'s the quickest way to do that? Or, what\'s the command that will delete all the rows of a table (and I\'

4条回答
  •  旧时难觅i
    2020-12-09 14:39

    Use SQL Server Management Studio to script the DROP and CREATE statements for the tables and then run the script. Right click on the database and select Tasks --> Generate Scripts. Run through the wizard (make sure to check the Script Drop option on the "Choose Script Options" step) and select all of the tables. The script that is generated should drop all the tables and then recreate them.

提交回复
热议问题