Sending data from Tag to Database

Hi guys, I have a memory tag which contains a dataset of 3 columns and 10 rows and the row will be updated by one or 2 daily. I need to sync this to a database table and this table has to be updated automatically daily.
I’m using a script to store the data inside the memory tag.

Write TagValue Change script on the same tag to push updated values in the DB

1 Like

Thanks for the reply. can you please provide me with an example?
First I need to load all those values to the DB from tag then it should have to be automatically updated.

That sounds like a backwards design. Store rows to the DB. Query to update the tag with the most recent data.

Thanks for the suggestion, I will take a look at it. My requirement is like I’m taking several data from the Gateway for eg: Project names, I thought of storing that to a memory tag so that it will much faster and I send that data to DB and from there I’m going to use that in my client. like a backup…Path is like gateway data-- memorytag-- DB-- taking to the client.

I’m beginner, please suggest me standardized way for this…

DB transactions are not tied to clients or frontend sessions. The gateway is in charge to talk with the database, keep that in mind.
Storing in a memory tag sounds ok if your database connection is faulty. Otherwise just keep data only in database.

If using a tag, I would a use transaction group for this with a 2 times daily trigger, but maybe is just a little overkilled.

I would avoid using tag change scripts, instead use scheduled script 2 times daily. Since 10 rows and 3 cols is a small set you should do it in a single query, first truncate and then insert updated data.