# Transaction group and table basic learning

**URL:** <https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747>\
**Category:** Ignition\
**Created:** [November 4, 2021, 7:43pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747 "2021-11-04T19:43:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [November 4, 2021, 7:43pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/1 "2021-11-04T19:43:16Z")

</div>

I made a table with my transaction group.

I removed all the things in the table to replace them.

The values that populate my table seem to be from the initial tags.

I have disabled and saved, enabled and saved. The new tags do not seem to replace the old ones.

So now I want to delete that table.

How do I delete that table? (so I can make it over again)

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [November 4, 2021, 8:01pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/2 "2021-11-04T20:01:32Z")

</div>

DROP TABLE _table\_name_ ;

found it on the w3school thing

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 4, 2021, 8:01pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/3 "2021-11-04T20:01:56Z")

</div>

execute this pseudo sql query

```auto
drop table <tablename>

```

be very careful when using this and make sure you type in the correct table name etc. When you drop a table, it truncates the data first then drops the table, so if you drop a table by accident I don’t think you can reverse it.

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [November 4, 2021, 8:03pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/4 "2021-11-04T20:03:18Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [November 4, 2021, 8:26pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/5 "2021-11-04T20:26:04Z")

</div>

I posted in features feedback a request that executing drop table would just rename the table the 7 days, and then delete it after that

so we could have 7 days of grace before we lose a database on a typo or something

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 4, 2021, 8:36pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/6 "2021-11-04T20:36:20Z")

</div>

```sql
ALTER TABLE table_name
RENAME TO new_table_name

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [November 4, 2021, 8:37pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/7 "2021-11-04T20:37:48Z")

</div>

Ignition has nothing to do with how drop table works, it only uses a driver to execute the query on the database. As @JordanCClark points out, you can just alter the table name, but if you don’t need it, it will still need to be dropped at some point.

---

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [September 27, 2023, 9:11pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/8 "2023-09-27T21:11:50Z")

</div>

> [@JordanCClark](#):
>
> ```python
> ALTER TABLE table_name
> RENAME TO new_table_name
> 
> ```

Where do you run this query? I'm trying to rename a table from the Database Query Browser and get this error when I use that command: SQL error for "ALTER TABLE group\_table RENAME table1": Incorrect syntax near 'RENAME

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 28, 2023, 10:51am UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/9 "2023-09-28T10:51:56Z")

</div>

You're missing 'TO'

```sql
ALTER TABLE group_table 
RENAME TO table1

```

---

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [September 28, 2023, 1:04pm UTC](https://forum.inductiveautomation.com/t/transaction-group-and-table-basic-learning/52747/10 "2023-09-28T13:04:07Z")

</div>

This week, I started using:

```auto
SELECT *
INTO new_table
FROM old_table
WHERE 1 = 0;

```

and

```auto
SELECT *
INTO new_table
FROM old_table

```

and

```auto
INSERT INTO new_table
SELECT *
FROM old_table

```

Then until my pages using queries get switched over, I have both table names active.
