Data Upgrade Manual Bulk Copy and generation of Direct SQL Scripts using X++ Job
- During data upgrade often it comes a requirement to run Bulk Copy for some tables which were unable to be Bulk Copied Before due to any reason (which could be table / field mapping issue etc..)
- Now if the particular tables were unable to be Bulk copied from source to target since there Direct Sql Script was not generated which is stored in ReleaseUpdateBulkCopyTable in AX 2012 in Field named 'DirectSQl' :
- To generate that DirectSQL script to perform Bulk Copy follow the following procedure:
- The class which handles the Bulk Copy process is 'ReleaseUpdateBulkCopyDB', few thing we will need prior to execute the below script is to Obtain the Source and Target connection string which could be obtaine from table 'RELEASEUPDATEBULKCOPYPARAMETERS',
- Use the following SQL Script to fetch this information :
- Select * from RELEASEUPDATEBULKCOPYPARAMETERS
- Copy the SourceConnectionString and TargetConnectionString and update the below X++ job :
static void BulkCopy(Args _args)
{
ReleaseUpdateBulkCopyTable ReleaseUpdateBulkCopyTable;
ReleaseUpdateBulkCopyDB BC = new ReleaseUpdateBulkCopyDB();
BC.setSourceConnection('<SourceConnectionString >');
BC.setTargetConnection('<TargetConnectionString>');
BC.initConnections();
while select ReleaseUpdateBulkCopyTable
where ReleaseUpdateBulkCopyTable.oldtablename== <tableName>
{
BC.bulkCopyTable(ReleaseUpdateBulkCopyTable);
}
}
Comments
Post a Comment