Page 1 of 1

TCRBatchMove workaround

Posted: Tue 23 May 2017 15:48
by ertank
Hello,

Using UniDAC 7.0.2.

As far as I know TCRBatchMove identify primary key in a TDataSet automatically. I would like to know if there is any way to provide primary key columns manually.

I am using TCRBatchMove between two detail tables. Both detail table's primary key is set on an autoincrement column. I would like to define TCRBatchMove to use two columns where second column is master link column. This will help me get rid of wrong append/update of records between source and destination because of different autoincrement column values in a multi-user environment.

Thanks.

Re: TCRBatchMove workaround

Posted: Fri 26 May 2017 10:03
by azyk
TCRBatchMove does not allow setting custom values for IDENTITY fields. For the issue solution, you can use TUniloader. In order for TUniloader to pass values of a primary key from a source table to the IDENTITY field of a destination table, set TUniLoader.SpecificOptions.Values['SQL Server.KeepIdentity'] to True. For data loading use the TUniLoader.LoadFromDataSet method.

More details about KeepIdentity: https://www.devart.com/unidac/docs/?sql ... tuniloader and TUniLoader: https://www.devart.com/unidac/docs/?dev ... loader.htm