Is there a way to have Tag History insert into a specific table instead of creating its own?

I have a value I want to historize, however, I want to be able to insert the value into a previously created table on my db, instead of having it create a new table. If this is not possible, is there a way to change the name of the table the tag history will create from 'sqlt_xxx' to a custom name without breaking the connection?

No.

The database tag historian uses an off the shelf database, but its inner workings should be considered opaque - you get to use your existing database, but you do not get control over the tables or their structure.

If you want control over storage of data, you must use transaction groups or scripting.

1 Like

Thanks for your answer. A little off-topic, but if I were to use scripting I would go for a Value Changed script, is it possible to incorporate a timed component to that script as well? For example, if the value hasn't changed in X amount of time, insert anyways.

Put your operation into a project library script function. Call that function unconditionally from the tag change event. Call that function conditionally, based last timestamp, from a gateway timer event.

(Do not perform database operations from a tag's own valueChange event unless you "fire-and-forget" with the store-and-forward system.)

Could a view help accomplish the goals of having a custom named table? (If you have pre-existing software that expects to read tag history from something named like 'history_xxx')