# How to drop delete sql table in ignition

**URL:** <https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 30, 2021, 4:39pm UTC](https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547 "2021-12-30T16:39:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam.Naji](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sam.naji/32/4657_2.png) [@Sam.Naji](https://forum.inductiveautomation.com/u/Sam.Naji)\
**Post date:** [December 30, 2021, 4:39pm UTC](https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547/1 "2021-12-30T16:39:20Z")

</div>

I am having trouble finding the syntax of how to drop an SQL table in Ignition.

When I use this code in my script “Drop Table [Ignition].[dbo].[PT\_Downtimme]”

I get this error:  
(**Parse error for event handler “actionPerformed” SyntaxError: (“no viable alternative at input ‘table’”, (’’, 1, 5, ‘drop table [Ignition].[dbo].[PT\_Downtimme] \n’)))**

Any help is greatly appreciated.  
Sam

---

<div class="post-metadata">

**Author:** ![Sam.Naji](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sam.naji/32/4657_2.png) [@Sam.Naji](https://forum.inductiveautomation.com/u/Sam.Naji)\
**Post date:** [December 30, 2021, 5:30pm UTC](https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547/2 "2021-12-30T17:30:42Z")

</div>

Never mind. I think I can do this in a store procedure.  
Thanks

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 30, 2021, 7:00pm UTC](https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547/3 "2021-12-30T19:00:15Z")

</div>

I looks like you were trying to put SQL directly in your python. SQL needs to be in a string, then sent to the database with an appropriate `system.db.run*()` function call. You have a parse error from _python_, not SQL.

{ `system.db.runUpdateQuery()` should work fine with a `DROP TABLE` statement, as long as Ignition’s connection has the appropriate permissions. }

---

<div class="post-metadata">

**Author:** ![Sam.Naji](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sam.naji/32/4657_2.png) [@Sam.Naji](https://forum.inductiveautomation.com/u/Sam.Naji)\
**Post date:** [December 30, 2021, 7:23pm UTC](https://forum.inductiveautomation.com/t/how-to-drop-delete-sql-table-in-ignition/54547/4 "2021-12-30T19:23:46Z")

</div>

Thank you, pturmel!
