# MS SQL Queries Adding Table Columns

**URL:** <https://forum.inductiveautomation.com/t/ms-sql-queries-adding-table-columns/23758>\
**Category:** Ignition\
**Created:** [April 1, 2019, 7:08pm UTC](https://forum.inductiveautomation.com/t/ms-sql-queries-adding-table-columns/23758 "2019-04-01T19:08:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [April 1, 2019, 8:11pm UTC](https://forum.inductiveautomation.com/t/ms-sql-queries-adding-table-columns/23758/2 "2019-04-01T20:11:01Z")

</div>

Not sure about the query, but I can link you to a post where I did something similar.

> [@Compact Table Scripting and Add IF statement to columnData.append](http://forum.inductiveautomation.com/t/compact-table-scripting-and-add-if-statement-to-columndata-append/18358/7):
>
> Looks much nicer than my rep rep repetitiveness ha ha. I got this code to work and initialize all Booleans to 0. Your code threw an error…TypeError: can’t put element of type class java.lang.Booleanin column of type class java.lang.Integer po = event.source.value data = system.db.runNamedQuery("BOM/PoDetails",{"po":po}) fields = ['5x5', '4x8', 'RB', 'HW'] for field in fields: columnData = [] for row in range(data.getRowCount()): ##description = data.getValueAt(row, "Description")## This…

---

_[View the full topic](https://forum.inductiveautomation.com/t/ms-sql-queries-adding-table-columns/23758)._
