# TRUNCATE like command?

**URL:** <https://community.influxdata.com/t/truncate-like-command/11436>\
**Category:** Systems\
**Created:** [October 1, 2019, 8:23am UTC](https://community.influxdata.com/t/truncate-like-command/11436 "2019-10-01T08:23:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukekhamilton](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/lukekhamilton/32/3696_2.png) [@lukekhamilton](https://community.influxdata.com/u/lukekhamilton)\
**Post date:** [October 1, 2019, 8:23am UTC](https://community.influxdata.com/t/truncate-like-command/11436/1 "2019-10-01T08:23:04Z")

</div>

Hey guys,

Somewhat new to influxdb and I was wondering is there a TRUNCATE like command at all? I have an influxdb I want to truncate and completely reset to an empty state on a deployment of some new code.  
Only way I can see to make this happen is via a drop and create however this causes issues with the app’s current codebase.

---

<div class="post-metadata">

**Author:** ![sauvant](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sauvant/32/3703_2.png) [@sauvant](https://community.influxdata.com/u/sauvant)\
**Post date:** [October 1, 2019, 1:22pm UTC](https://community.influxdata.com/t/truncate-like-command/11436/2 "2019-10-01T13:22:11Z")

</div>

Hi,

I am not aware of any. But does not mean a thing because I am new here 😉

What I currently use is “DELETE FROM [MEASUREMENT\_NAME]”  
You should know all measurements you use. Otherwise a “SHOW MEASUREMENTS” will tell you.

Best regards  
Keith

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 1, 2019, 5:26pm UTC](https://community.influxdata.com/t/truncate-like-command/11436/3 "2019-10-01T17:26:14Z")

</div>

Hello @lukekhamilton,  
Thank you for your question. You can drop a database or delete a series. Since InfluxDB is an append-only DB, it doesn’t have as many management commands as SQL. Please take a look at the InfluxDB docs [here](https://docs.influxdata.com/influxdb/v1.7/query_language/database_management/).

---

<div class="post-metadata">

**Author:** ![Kevin-Chen0](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@Kevin-Chen0](https://community.influxdata.com/u/Kevin-Chen0)\
**Post date:** [October 23, 2019, 4:15am UTC](https://community.influxdata.com/t/truncate-like-command/11436/4 "2019-10-23T04:15:44Z")

</div>

Hi @Anaisdg,

DELETE and TRUNCATE are only for InfluxQL? Are there any equivalent for Flux, since I presume that is the only query language for InfluxDB 2.0. There is the drop() function for Flux, but I tried the following and it is not working for me. The data is still there:

from(bucket: “aq-raw”)  
|\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
|\> drop(columns: [“”, “\_measurement”])

> **[drop() function | Flux 0.x Documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/drop/)**
>
> drop() removes specified columns from a table.

I guess maybe that query function isn’t needed in 2.0, because you can set the data Retention policy? Even so, I would still like to have that DELETE ALL control on hand just in case.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [October 25, 2019, 10:09pm UTC](https://community.influxdata.com/t/truncate-like-command/11436/5 "2019-10-25T22:09:00Z")

</div>

Hey @Kevin-Chen0,  
Please take a look at this other [community question](https://community.influxdata.com/t/drop-measurement-for-influxdb-2-x/11399/2) for your answer. Thanks!
