# Custom SQL Table Logging for Edge to Central Gateway Sync Data

**URL:** <https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978>\
**Category:** Ignition\
**Tags:** ignition81, edge\
**Created:** [January 16, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978 "2025-01-16T15:39:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [January 16, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/1 "2025-01-16T15:39:11Z")

</div>

Hello,  
I have configured Tag Data Sync between an Edge Gateway (8.1.44) and Central Gateway (8.1.43), and it's working as expected. When the Central services are stopped and restarted, no data is lost, as the Edge and PLC stay connected and sync data once the network is restored.

However, I’d like to know if there’s a way to log this synced data from Edge to Central in a custom SQL table with a specific structure and defined columns, rather than using the default format.

Any guidance would be appreciated!

---

<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 16, 2025, 4:03pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/2 "2025-01-16T16:03:34Z")

</div>

No, Edge only supports Ignition's standard historian tables.

If you need custom database tables, don't use Edge.

---

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [January 17, 2025, 11:09am UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/3 "2025-01-17T11:09:15Z")

</div>

Thank you for your response. I understand that Edge supports only Ignition's standard historian tables. However, I’m specifically looking for a way to log the synced data into custom SQL tables in the **Central** server (not in Edge). Is there any possible way to achieve this, perhaps using custom scripting or other methods on the Central server?

Any further guidance would be greatly appreciated!

---

<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 17, 2025, 1:13pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/4 "2025-01-17T13:13:06Z")

</div>

> [@Yogesh\_Garud](#):
>
> in the **Central** server

Yes, I understood that. There's no way to intercept the history data delivered to the central server before it is inserted into the central server's database in history format. And that format is one tag value per row, with no synchronization of timestamps, so there's no practical way to reshape into the "wide" tables you are after. You must generate wide **rows** at the source, but Edge cannot do that.

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [January 17, 2025, 2:57pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/5 "2025-01-17T14:57:17Z")

</div>

If you're looking to log data from tags in a specific format, I'd recommend using Ignition's [SQL-Bridge module](https://inductiveautomation.com/ignition/modules/sql-bridge). For your case specifically, you'd either need to connect your central gateway directly to those tags to use the module, or you could purchase a new Ignition license with only the base and module (no expensive visualization component required!)

I think this module would give you exactly what you're looking for with minimal effort on your part (besides the cost of course).

A [Historical Group](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/sql-bridge-transaction-groups/types-of-groups#historical-group) would fit best for this too.

---

<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 17, 2025, 3:13pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/6 "2025-01-17T15:13:17Z")

</div>

> [@Brandon\_Peterson](#):
>
> exactly what you're looking for

If they are relying on Edge's store and forward, putting SQL Bridge in the central server will be a disappointment. All data while disconnected will be lost.

---

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [January 17, 2025, 3:18pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/7 "2025-01-17T15:18:28Z")

</div>

> [@pturmel](#):
>
> on Edge's store and forward

@Brandon_Peterson Thanks for your suggestion.  
but  
@pturmel That's a valid point. We have data synchronization in both the edge and central servers to ensure zero data loss, even if the central server services are stopped and later restarted. This functionality is working as expected.

However, historical data from the central server is needed in a custom sql table format for the next data processing step.

---

<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 17, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/8 "2025-01-17T15:27:23Z")

</div>

You have two paths forward, as I see it:

- Change from Edge to Standard Ignition in your facilities. Make an ordinary database connection there and use either SQL Bridge Transaction Groups to insert through the standard S&F engine, or script your data storage using `system.db.runSFPrepUpdate()`.

- Write schedule scripts in your Central server to retrieve historical data, repackage it into the desired format, normalized timestamps to correlate as best you can, and insert to your custom tables.

I would choose option #1. Option #2 is likely to be a nightmare.

---

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [January 17, 2025, 3:53pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/9 "2025-01-17T15:53:47Z")

</div>

Option #1 appears to be quite challenging for me, as there is no longer any use of Standard Ignition on the shop floor. Currently, we only have a single device connection with a 7-day data log (which is quite rare), and no screens or additional functionality in place.

Regarding Option #2, I am open to exploring it further, as I have previously used SQL Transaction Groups to log data, and functionality and screens were developed based on that approach.  
Please let me know if there's an opportunity for further clarity or assistance with Option #2 or other alternatives.

---

<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 17, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/10 "2025-01-17T15:57:59Z")

</div>

> [@Yogesh\_Garud](#):
>
> further clarity or assistance with Option #2

Nightmare. I wouldn't touch it without a T&M Purchase Order. And it would stay at the **bottom** of my to-do list. 🤢

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [January 17, 2025, 4:33pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/11 "2025-01-17T16:33:06Z")

</div>

An Option #3 might be to challenge the requirement for custom tables. Would you be able to create methods by which other sources are able to access the default Ignition Historian data tables in a 'universal' way?

Edit: A couple of examples:

- Create a SQL View which returns a customized table to the user based on a more complicated series of queries.
- Create an API (via WebDev module) which utilizes Ignition functions to return the customized table to the user.

---

<div class="post-metadata">

**Author:** ![Brandon\_Peterson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brandon_peterson/32/32960_2.png) [@Brandon\_Peterson](https://forum.inductiveautomation.com/u/Brandon_Peterson)\
**Post date:** [January 17, 2025, 4:56pm UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/12 "2025-01-17T16:56:43Z")

</div>

Option #1 _would_ require a new license, and you could put it on the same computer/server/device.

> [@Yogesh\_Garud](#):
>
> there is no longer any use of Standard Ignition on the shop floor.

This sounds like either a standard/rule or a description, either of which are worth changing, imho. The time and hassle it'll save you to do this custom data format thing of yours could justify the extra cost too.

I'll leave the rest to you and the others to make this decision. I don't mean to push my opinion any further, just wanted to clarify a bit.

---

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [January 20, 2025, 9:31am UTC](https://forum.inductiveautomation.com/t/custom-sql-table-logging-for-edge-to-central-gateway-sync-data/100978/13 "2025-01-20T09:31:00Z")

</div>

@pturmel , @Chris_Bingham & @Brandon_Peterson

Thank you for your valuable suggestions. I need to discuss these options with my end client and will make a decision based on that. Thanks again.
