# Update SQL Table of multiple rows with different identifiers

**URL:** <https://discourse.nodered.org/t/update-sql-table-of-multiple-rows-with-different-identifiers/66632>\
**Category:** Share Your Projects\
**Created:** [19 August 2022 03:11 UTC](https://discourse.nodered.org/t/update-sql-table-of-multiple-rows-with-different-identifiers/66632 "2022-08-19T03:11:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Kimo](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@Kimo](https://discourse.nodered.org/u/Kimo)\
**Post date:** [9 October 2022 06:30 UTC](https://discourse.nodered.org/t/update-sql-table-of-multiple-rows-with-different-identifiers/66632/4 "2022-10-09T06:30:57Z")

</div>

Nevermind. Thank you for replying. I have managed to solve this. Everyone have same application can refer to this post below. Thank you

> [@How to update SQL query with an identifier has 2 strings](https://discourse.nodered.org/t/how-to-update-sql-query-with-an-identifier-has-2-strings/66647/6):
>
> that is not what I said to do... e.g.. const array = flow.get('array'); //example ["A1", "A2"]; if(!array || !array.length) { node.warn("array is empty"); return null // halt flow } const whereClause = "(" + array.map(e =\> "'" + e + "'").join(",") + ");" const now = new Date().toLocaleString("en-GB"); msg.payload = "UPDATE [dbo].[Background] SET [Start\_Time] = '" + now + "' WHERE [Name] in " + whereClause; return msg;

---

_[View the full topic](https://discourse.nodered.org/t/update-sql-table-of-multiple-rows-with-different-identifiers/66632)._
