Axapta Transactions Deletion

Hello All,

I have started the axapta transactions deletion by using SysDatabaseTransDelete class for about 3 years data then after long hours axapta was not responding and the database transaction log started increasing and db server was left with low disk space. How can i reduce the transaction log of db or set not to grow larger ?

Any help will be appreciated.



Hi Syed,

You can detach the database and than delete the ldf file.

After that, reattach the database. Log file will get created automatically with low size.

For safer side, do keep the backup of log file for some moment.

Another suggestion, isntead of deleting transaction through class, you can delete the transactions through sql queries. Although it will be tedious but it will save lot of time.


Thanks for quick reply.

I tried the same detaching process but transaction log is still increasing and showing low disk space on server. But your another suggestion is quite good and can u point or give me that script.

Hey, i guess you must have stopped the process in ax before detaching.

yes… i have stopped the ax process because server was on low disk… anyway… i will restore the backup to another machine and try the sql script. Can u provide me the script …!!!


Check the recovery model of your AX database. (How to check recovery model -

If this is to set to full (this is the default setting), change it to simple recovery model. And then run the database trans delete class.

After you are finished, revert the recovery model to default setting.

PS - as always, please backup database before you try this.

Thanks Harish…

Currently the database is in recovery mode. After it finishes then i will set to simple and try deleting transactions.


Always use ‘SysDatabaseTransDelete’ class to delete transactions. This class is written with performance in mind. Making the change I mentioned above, should make deletion process fairly quicker.

If you try to delete data manually, you might get into unncessary tangles and this might end up corrupting database integrity.

Even after setting the database recovery to simple, the log was growing, So, i set a breakpoint in the SysDatabaseTransDelete to see the table which axapta is trying to delete and truncated the table from sql server. I considered truncating only those table which were having huge number of transactions. At last, it worked.