SQL Truncate, Delete, Drop advise

后端 未结 6 1584
礼貌的吻别
礼貌的吻别 2021-01-15 03:17

I have a table in a SQL db that I want to remove the data from? I want to keep the columns though.

e.g. my table has 3 columns, Name, Age, Date. I don\'t want to rem

6条回答
  •  北恋
    北恋 (楼主)
    2021-01-15 04:06

    Don't drop - it will delete the data and the definition.
    If you delete - the data is gone and auto-increment values go on from the last value.
    If you truncate - then it is like you just did create the table. No data and all counters resetted

提交回复
热议问题