# What is the canonical way to do a database "upsert" using scripting?

**URL:** <https://forum.inductiveautomation.com/t/what-is-the-canonical-way-to-do-a-database-upsert-using-scripting/42785>\
**Category:** General Discussion\
**Tags:** ignition80\
**Created:** [January 30, 2021, 3:41pm UTC](https://forum.inductiveautomation.com/t/what-is-the-canonical-way-to-do-a-database-upsert-using-scripting/42785 "2021-01-30T15:41:36Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [January 30, 2021, 4:21pm UTC](https://forum.inductiveautomation.com/t/what-is-the-canonical-way-to-do-a-database-upsert-using-scripting/42785/3 "2021-01-30T16:21:53Z")

</div>

Looks like the closest equivalent for SQL Server is the `MERGE` statement. SQL Server 2019 does not support the standard’s `ON CONFLICT` clause.

---

_[View the full topic](https://forum.inductiveautomation.com/t/what-is-the-canonical-way-to-do-a-database-upsert-using-scripting/42785)._
