# A result set was generated for an update

**URL:** <https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558>\
**Category:** Ignition\
**Created:** [July 18, 2023, 11:06pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558 "2023-07-18T23:06:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [July 18, 2023, 11:06pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/1 "2023-07-18T23:06:50Z")

</div>

Ignition 7.9.20 on Windows 12 Server

SQL Server 2019 on another computer.

For 7 years we have had the following working in a python script:

```auto
sql = \
"""
INSERT INTO table (col_1, col_2, col_3)
VALUES (?, ?, ?)
"""
system.db.runPrepUpdate(sql, [1, 2, 3])

```

Yesterday this started throwing errors "A result set was generated for an update...."

The script was changed to:

```auto
sql = \
"""
SET NOCOUNT OFF
INSERT INTO table (col_1, col_2, col_3)
VALUES (?, ?, ?)
"""
system.db.runPrepUpdate(sql, [1, 2, 3])

```

And it now works. Any idea why this failure could happen and why the fix fixes it?

TIA  
Mack

---

<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:** [July 18, 2023, 11:12pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/2 "2023-07-18T23:12:26Z")

</div>

I would guess someone on the DB side applied a patch that changed the default for the NOCOUNT setting.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [July 18, 2023, 11:12pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/3 "2023-07-18T23:12:48Z")

</div>

They swear not.

---

<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:** [July 18, 2023, 11:13pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/4 "2023-07-18T23:13:37Z")

</div>

There's not much else it can be.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [July 18, 2023, 11:17pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/5 "2023-07-18T23:17:05Z")

</div>

There are many other similar scripts that are not failing....

---

<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:** [July 18, 2023, 11:23pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/6 "2023-07-18T23:23:41Z")

</div>

Recycled connections might be holding onto the original defautls. Try disabling and re-enabling the DB connection. You'll probably see the rest of the scripts start to fail.

Consider adding `SET NOCOUNT ON` to the DB connection's initialization.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [July 18, 2023, 11:40pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/7 "2023-07-18T23:40:20Z")

</div>

Would that be in the Extra Connection Properties? Is a keyword required before it?

---

<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:** [July 18, 2023, 11:42pm UTC](https://forum.inductiveautomation.com/t/a-result-set-was-generated-for-an-update/76558/8 "2023-07-18T23:42:24Z")

</div>

Yes, not sure. I haven't used it with MS SQL Server.
