# Create SQL TABLE with Variable name

**URL:** <https://forum.inductiveautomation.com/t/create-sql-table-with-variable-name/29012>\
**Category:** Ignition\
**Created:** [October 10, 2019, 9:09pm UTC](https://forum.inductiveautomation.com/t/create-sql-table-with-variable-name/29012 "2019-10-10T21:09:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juan](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@juan](https://forum.inductiveautomation.com/u/juan)\
**Post date:** [October 10, 2019, 9:09pm UTC](https://forum.inductiveautomation.com/t/create-sql-table-with-variable-name/29012/1 "2019-10-10T21:09:24Z")

</div>

Good Afternoon,

I’m trying to write a script that creates tables to my database, I want to name the table with the contents of a string variable,  
is this possible?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [October 10, 2019, 10:51pm UTC](https://forum.inductiveautomation.com/t/create-sql-table-with-variable-name/29012/2 "2019-10-10T22:51:55Z")

</div>

```auto
tableName = your string
system.db.runUpdateQuery("""CREATE TABLE "%s" (Name VARCHAR(100) NOT NULL)""" % tableName)

```
