Hi,
I have created a table in AX that is used to cache some values from other tables, and I’m trying to fill it using a stored procedure (SQL).
I’m currently executing the procedure in AX (x++), and inserting its result into the target table, but sometimes it throws errors ( “[Microsoft][SQL Server Native Client 11.0]Connection is busy with results for another command” ),
plus it takes a longer time to finish because it’s inserting the records one by one.
So now I’m trying to fill the table through SQL, but the issue I’m facing is filling the ‘RecId’ field.
I know that AX uses the “SystemSequences” table to read the next ‘RecId’ for a given table id, and I can read from it and update it as needed, but I’ve heard that AX does some internal caching of the next RecIds, and that we may need to restart AOS whenever we edit the “SystemSequences” record manually (which is not possible in our scenario, since we’ll run this procedure multiple times a day).
So my question is, If I can guarantee that nobody will create a new record of the cache table through AX (it’s only used for some reports), and that no table will be linked with it using its ‘RecId’,
can I fill this table in SQL, give its ‘RecId’ fields unique values, and update the “SystemSequences” table accordingly, without causing any problem to AX internal system?
Thanks