# Problem result sql query

**URL:** <https://forum.inductiveautomation.com/t/problem-result-sql-query/86345>\
**Category:** Ignition\
**Created:** [February 26, 2024, 8:52am UTC](https://forum.inductiveautomation.com/t/problem-result-sql-query/86345 "2024-02-26T08:52:39Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [February 26, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/problem-result-sql-query/86345/7 "2024-02-26T17:54:30Z")

</div>

I know of no way to do that with MS SQL Server. If you adopt a competent database technology, you can use SQL UNNEST() and similar technologies:

> [@Taking a Dataset and Inserting it to a SQL temp table](https://forum.inductiveautomation.com/t/taking-a-dataset-and-inserting-it-to-a-sql-temp-table/83852/4):
>
> If you were using a competent database (the following is PostgreSQL), you can pass java arrays as arguments, and unnest() them in a FROM clause. For an example, I created a table in my psql forum playground called phrases, to be used in a join. When queried by itself, you get this dataset: "#NAMES" "prefix","suffix" "#TYPES" "str","I" "#ROWS","4" "Hello","1" "Good Bye","2" "Welcome to","3" "Whoa!","4" To go with that, in a custom property named lookups, I created the following unbound datase…

However, most people would combine the SELECT and the INSERT in a single statement, using this general syntax:

```auto
INSERT INTO someTable (someColumns....)
SELECT matchingColumns....
FROM ....

```

In the `matchingColumns` list of expressions, you might include expressions like:

```auto
    ? AS aColumnName

```

to inject desired constants into every new row.

---

_[View the full topic](https://forum.inductiveautomation.com/t/problem-result-sql-query/86345)._
