Change the column length when automatically create table And Insert

Is there any way to change the column length when a transaction group creates a new column or table? I want to set the default column type to nvarchar(MAX) without manually executing the ALTER script in the database.

And if the string length exceeds 4000 characters, it will be truncated to 4000 because Ignition sets the parameter as nvarchar(4000) when the transaction group inserts data into the data table. Is there any way to change it to nvarchar(MAX)?

Meanwhile, I’m trying to prevent my string from being truncated by creating a new tag change event in the gateway. However, I found that the INSERT SQL executed by the transaction group runs after the SQL executed by tag changes. This seems unreasonable to me.

When my tag a is set to true, it should trigger the transaction group to insert the information into the data table at that moment. After that, the transaction group should reset tag a to false, triggering my tag change event to execute an UPDATE SQL statement. The UPDATE SQL should execute after the INSERT, so why does the UPDATE execute first?

Thanks~

Legacy DB version support, I suspect. I don't think there's any way to change that.

Are you routing through the Store and Forward system for the transaction group? That will delay its actual SQL execution.

Thanks for answering my questions.
I'll confirm that with Ignition support.