Friday, March 24, 2017

Copy data from a table to another Ax2012

Hi guys,

Another short code for copying data from one table to another (backupTable). This is useful when you have to take backup of the data while you want to perform some operations of the production data (original table) or maybe to resolve some DB sync issues.

static void AKS_CopyTableData(Args _args)
{
    EcomInboundInventoryUpdate          origTable;
    Backup_EcomInboundInventoryUpdate   copyTable;

    ttsBegin;
    delete_from copyTable;

    while select origTable
    {
        buf2Buf(origTable, copyTable);
        copyTable.insert();
    }

    ttsCommit;
}

No comments:

Post a Comment